Makefile : some corrections suggested by Michał Górny (issue 136)

This commit is contained in:
Yann Collet 2014-07-21 21:01:59 +01:00
parent 64547df2de
commit 2c15ec421a
3 changed files with 22 additions and 15 deletions

View File

@ -1,6 +1,6 @@
language: c
compiler: gcc
script: make test
script: make test-travis
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-multilib

View File

@ -41,7 +41,8 @@ LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
DESTDIR=
PREFIX = /usr
CC := $(CC)
CFLAGS+= -I. -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\"
CFLAGS?= -O3
CFLAGS+= -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\"
LIBDIR?= $(PREFIX)/lib
INCLUDEDIR=$(PREFIX)/include
@ -93,10 +94,10 @@ lz4programs: lz4.c lz4hc.c
liblz4: lz4.c lz4hc.c
@echo compiling static library
@$(CC) $(CFLAGS) -c $^
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $^
@$(AR) rcs liblz4.a lz4.o lz4hc.o
@echo compiling dynamic library
@$(CC) $(CFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
@$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
@echo creating versioned links
@ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR)
@ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT)
@ -158,7 +159,10 @@ dist: clean
@sha1sum $(DISTRIBNAME) > $(DISTRIBNAME).sha1
@echo Distribution $(DISTRIBNAME) built
test: lz4programs
test:
@cd $(PRGDIR); $(MAKE) -e $@
test-travis: lz4programs
@cd $(PRGDIR); $(MAKE) -e $@
endif

View File

@ -30,27 +30,28 @@
# fullbench32: Same as fullbench, but forced to compile in 32-bits mode
# ##########################################################################
RELEASE=rc120
RELEASE=r120
DESTDIR=
PREFIX=/usr
CC:=$(CC)
CFLAGS+= -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS= -I.. $(CFLAGS)
CFLAGS?= -O3
CFLAGS+= -std=c99 -Wall -Wextra -Wundef -Wshadow -Wstrict-prototypes -DLZ4_VERSION=\"$(RELEASE)\"
FLAGS= -I.. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man/man1
LZ4DIR=..
TEST_FILES = COPYING
TEST_TARGETS=test-64 test-32
TEST_TARGETS=test
BENCH_NB=-i5
# Minimize test target for Travis CI's Build Matrix
ifeq ($(LZ4_TRAVIS_CI_ENV),-m32)
TEST_TARGETS=test-32
TEST_TARGETS=test-force32
BENCH_NB=-i1
else ifeq ($(LZ4_TRAVIS_CI_ENV),-m64)
TEST_TARGETS=test-64
TEST_TARGETS=test
BENCH_NB=-i1
endif
@ -125,11 +126,13 @@ uninstall:
[ -f $(DESTDIR)$(MANDIR)/lz4cat.1 ] && rm -f $(DESTDIR)$(MANDIR)/lz4cat.1
@echo lz4 successfully uninstalled
test: $(TEST_TARGETS)
test: test-lz4 test-lz4c test-fullbench test-fuzzer test-mem
test-64: test-lz4 test-lz4c test-fullbench test-fuzzer test-mem
test-force32: test-lz4c32 test-fullbench32 test-fuzzer32 test-mem32
test-32: test-lz4 test-lz4c32 test-fullbench32 test-fuzzer32 test-mem32
test-all: test test-force32
test-travis: $(TEST_TARGETS)
test-lz4: lz4 datagen
./datagen | ./lz4 | ./lz4 -vdq > $(VOID)
@ -138,7 +141,7 @@ test-lz4: lz4 datagen
test-lz4c: lz4c datagen
test-lz4c32: lz4c32 lz4 datagen
test-lz4c32: lz4 lz4c32 lz4 datagen
./datagen | ./lz4c32 | ./lz4c32 -vdq > $(VOID)
./datagen | ./lz4c32 | ./lz4 -vdq > $(VOID)
./datagen -g256MB | ./lz4c32 -vqB4D | ./lz4c32 -vdq > $(VOID)