summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-07-21 20:01:59 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-07-21 20:01:59 (GMT)
commit2c15ec421ad03a097d5313ef3ed1039644cb74bf (patch)
tree8a0b70a39d1a376f9eda21961547141abdb499a8 /Makefile
parent64547df2dec94632ca8d5dd42b07c22a169b70b7 (diff)
downloadlz4-2c15ec421ad03a097d5313ef3ed1039644cb74bf.zip
lz4-2c15ec421ad03a097d5313ef3ed1039644cb74bf.tar.gz
lz4-2c15ec421ad03a097d5313ef3ed1039644cb74bf.tar.bz2
Makefile : some corrections suggested by Michał Górny (issue 136)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f9775db..45b9098 100644
--- a/Makefile
+++ b/Makefile
@@ -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