diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-09-23 03:59:02 (GMT) |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-09-23 03:59:02 (GMT) |
commit | 43b631223b2d0425a0970876974074934f89c450 (patch) | |
tree | 6e683a2e62a7900980f0d508396bcd26bc24ea9e /lib/Makefile | |
parent | 1ca408105d7774bd1f379b9ec695ac7579cd456c (diff) | |
download | lz4-43b631223b2d0425a0970876974074934f89c450.zip lz4-43b631223b2d0425a0970876974074934f89c450.tar.gz lz4-43b631223b2d0425a0970876974074934f89c450.tar.bz2 |
add a flag to disable static libs
Diffstat (limited to 'lib/Makefile')
-rw-r--r-- | lib/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index b5352a0..27b35c4 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 |