diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2016-09-23 13:59:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 13:59:39 (GMT) |
commit | 52cdb4a5f4630b57ebf5ab20ae0447aefa623160 (patch) | |
tree | 630c69a69b59e6a4de315d07baf75dbd6ce97dcc | |
parent | c5cb4aa52a3efa668cf7d8fd0d9678774b699d2e (diff) | |
parent | 43b631223b2d0425a0970876974074934f89c450 (diff) | |
download | lz4-52cdb4a5f4630b57ebf5ab20ae0447aefa623160.zip lz4-52cdb4a5f4630b57ebf5ab20ae0447aefa623160.tar.gz lz4-52cdb4a5f4630b57ebf5ab20ae0447aefa623160.tar.bz2 |
Merge pull request #241 from vapier/dev
add a flag to disable static libs
-rw-r--r-- | lib/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index a653b65..bd47ee3 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -40,6 +40,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) +BUILD_STATIC:= yes DESTDIR?= PREFIX ?= /usr/local @@ -71,9 +72,11 @@ default: liblz4 all: liblz4 liblz4: *.c +ifeq ($(BUILD_STATIC),yes) @echo compiling static library @$(CC) $(FLAGS) -c $^ @$(AR) rcs $@.a *.o +endif @echo compiling dynamic library $(LIBVER) @$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) @echo creating versioned links @@ -104,7 +107,9 @@ install: liblz4 liblz4.pc @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) @install -m 644 liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ +ifeq ($(BUILD_STATIC),yes) @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a +endif @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h @install -m 644 lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h |