summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-23 00:45:40 (GMT)
committerYann Collet <cyan@fb.com>2019-04-23 00:45:40 (GMT)
commit229b016f507cdc0db300c22ac4ec8bab7cd0874f (patch)
tree34144af1208f92e528a9ec7a9df0d67812d69765 /lib
parent1e700b6f85bbc9e7052190f2f686041367321766 (diff)
parent291b3d8b7e61efc260639c731a3b429419cbc471 (diff)
downloadlz4-229b016f507cdc0db300c22ac4ec8bab7cd0874f.zip
lz4-229b016f507cdc0db300c22ac4ec8bab7cd0874f.tar.gz
lz4-229b016f507cdc0db300c22ac4ec8bab7cd0874f.tar.bz2
Merge branch 'dev' of github.com:Cyan4973/lz4 into dev
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile26
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/Makefile b/lib/Makefile
index cb1571c..28853df 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -45,7 +45,6 @@ LIBVER := $(shell echo $(LIBVER_SCRIPT))
BUILD_SHARED:=yes
BUILD_STATIC:=yes
-OS ?= $(shell uname)
CPPFLAGS+= -DXXH_NAMESPACE=LZ4_
CFLAGS ?= -O3
DEBUGFLAGS:= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
@@ -71,11 +70,7 @@ else
SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
endif
-ifneq (,$(filter Windows%,$(OS)))
-LIBLZ4 = liblz4-$(LIBVER_MAJOR)
-else
-LIBLZ4 = liblz4.$(SHARED_EXT_VER)
-endif
+include ../Makefile.inc
.PHONY: default
default: lib-release
@@ -106,8 +101,8 @@ endif
$(LIBLZ4): $(SRCFILES)
ifeq ($(BUILD_SHARED),yes) # can be disabled on command line
@echo compiling dynamic library $(LIBVER)
-ifneq (,$(filter Windows%,$(OS)))
- $(Q)$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll/$@.dll -Wl,--out-implib,dll/liblz4.lib
+ifeq ($(WINBASED),yes)
+ $(Q)$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll/$@.dll -Wl,--out-implib,dll/$(LIBLZ4_EXP)
else
$(Q)$(CC) $(FLAGS) -shared $^ -fPIC -fvisibility=hidden $(SONAME_FLAGS) -o $@
@echo creating versioned links
@@ -116,18 +111,19 @@ else
endif
endif
+ifeq (,$(filter MINGW%,$(TARGET_OS)))
liblz4: $(LIBLZ4)
+endif
clean:
- $(Q)$(RM) core *.o liblz4.pc dll/liblz4.dll dll/liblz4.lib
+ $(Q)$(RM) core *.o liblz4.pc dll/$(LIBLZ4).dll dll/$(LIBLZ4_EXP)
$(Q)$(RM) *.a *.$(SHARED_EXT) *.$(SHARED_EXT_MAJOR) *.$(SHARED_EXT_VER)
@echo Cleaning library completed
-
#-----------------------------------------------------------------------------
# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW32_NT-6.1 MINGW64_NT-6.1 MINGW32_NT-10.0 MINGW64_NT-10.0))
+ifeq ($(POSIX_ENV),Yes)
.PHONY: listL120
listL120: # extract lines >= 120 characters in *.{c,h}, by Takayuki Matsuoka (note : $$, for Makefile compatibility)
@@ -184,9 +180,9 @@ ifeq ($(BUILD_SHARED),yes)
# Traditionnally, one installs the DLLs in the bin directory as programs
# search them first in their directory. This allows to not pollute system
# directories (like c:/windows/system32), nor modify the PATH variable.
-ifneq (,$(filter Windows%,$(OS)))
+ifeq ($(WINBASED),yes)
$(Q)$(INSTALL_PROGRAM) dll/$(LIBLZ4).dll $(DESTDIR)$(bindir)
- $(Q)$(INSTALL_PROGRAM) dll/liblz4.lib $(DESTDIR)$(libdir)
+ $(Q)$(INSTALL_PROGRAM) dll/$(LIBLZ4_EXP) $(DESTDIR)$(libdir)
else
$(Q)$(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)
$(Q)ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR)
@@ -201,9 +197,9 @@ endif
uninstall:
$(Q)$(RM) $(DESTDIR)$(pkgconfigdir)/liblz4.pc
-ifneq (,$(filter Windows%,$(OS)))
+ifeq (WINBASED,1)
$(Q)$(RM) $(DESTDIR)$(bindir)/$(LIBLZ4).dll
- $(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.lib
+ $(Q)$(RM) $(DESTDIR)$(libdir)/$(LIBLZ4_EXP)
else
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT)
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR)