This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lz4#693 from JPeterMugaas/master
More build imrpvements
- Loading branch information
Showing
6 changed files
with
173 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,37 +85,49 @@ all: lib | |
all32: CFLAGS+=-m32 | ||
all32: all | ||
|
||
ifeq ($(V), 1) | ||
Q = | ||
else | ||
Q = @ | ||
endif | ||
|
||
liblz4.a: $(SRCFILES) | ||
ifeq ($(BUILD_STATIC),yes) # can be disabled on command line | ||
@echo compiling static library | ||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ | ||
$(Q)$(AR) rcs $@ *.o | ||
endif | ||
|
||
ifeq ($(WINBASED),yes) | ||
liblz4-dll.rc: liblz4-dll.rc.in | ||
@echo creating library resource | ||
$(Q)sed -e 's|@LIBLZ4@|$(LIBLZ4)|' \ | ||
-e 's|@LIBVER_MAJOR@|$(LIBVER_MAJOR)|g' \ | ||
-e 's|@LIBVER_MINOR@|$(LIBVER_MINOR)|g' \ | ||
-e 's|@LIBVER_PATCH@|$(LIBVER_PATCH)|g' \ | ||
$< >$@ | ||
|
||
liblz4-dll.o: liblz4-dll.rc | ||
$(WINDRES) -i liblz4-dll.rc -o liblz4-dll.o | ||
|
||
$(LIBLZ4): $(SRCFILES) liblz4-dll.o | ||
else | ||
$(LIBLZ4): $(SRCFILES) | ||
endif | ||
ifeq ($(BUILD_SHARED),yes) # can be disabled on command line | ||
@echo compiling dynamic library $(LIBVER) | ||
ifeq ($(WINBASED),yes) | ||
ifeq ($(WINBASED),yes) | ||
$(Q)$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll/[email protected] -Wl,--out-implib,dll/$(LIBLZ4_EXP) | ||
else | ||
else | ||
$(Q)$(CC) $(FLAGS) -shared $^ -fPIC -fvisibility=hidden $(SONAME_FLAGS) -o $@ | ||
@echo creating versioned links | ||
$(Q)ln -sf $@ liblz4.$(SHARED_EXT_MAJOR) | ||
$(Q)ln -sf $@ liblz4.$(SHARED_EXT) | ||
endif | ||
$(Q)$(LN_SF) $@ liblz4.$(SHARED_EXT_MAJOR) | ||
$(Q)$(LN_SF) $@ liblz4.$(SHARED_EXT) | ||
endif | ||
endif | ||
|
||
ifeq (,$(filter MINGW%,$(TARGET_OS))) | ||
liblz4: $(LIBLZ4) | ||
endif | ||
|
||
clean: | ||
ifeq ($(WINBASED),yes) | ||
$(Q)$(RM) *.rc | ||
endif | ||
$(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 | ||
|
@@ -144,22 +156,13 @@ libdir ?= $(LIBDIR) | |
INCLUDEDIR ?= $(prefix)/include | ||
includedir ?= $(INCLUDEDIR) | ||
|
||
ifneq (,$(filter $(OS),OpenBSD FreeBSD NetBSD DragonFly MidnightBSD)) | ||
ifneq (,$(filter $(TARGET_OS),OpenBSD FreeBSD NetBSD DragonFly MidnightBSD)) | ||
PKGCONFIGDIR ?= $(prefix)/libdata/pkgconfig | ||
else | ||
else | ||
PKGCONFIGDIR ?= $(libdir)/pkgconfig | ||
endif | ||
endif | ||
pkgconfigdir ?= $(PKGCONFIGDIR) | ||
|
||
ifneq (,$(filter $(OS),SunOS)) | ||
INSTALL ?= ginstall | ||
else | ||
INSTALL ?= install | ||
endif | ||
|
||
INSTALL_PROGRAM ?= $(INSTALL) | ||
INSTALL_DATA ?= $(INSTALL) -m 644 | ||
|
||
liblz4.pc: liblz4.pc.in Makefile | ||
@echo creating pkgconfig | ||
$(Q)sed -e 's|@PREFIX@|$(prefix)|' \ | ||
|
@@ -169,26 +172,26 @@ liblz4.pc: liblz4.pc.in Makefile | |
$< >$@ | ||
|
||
install: lib liblz4.pc | ||
$(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(pkgconfigdir)/ $(DESTDIR)$(includedir)/ $(DESTDIR)$(libdir)/ $(DESTDIR)$(bindir)/ | ||
$(Q)$(INSTALL_DIR) $(DESTDIR)$(pkgconfigdir)/ $(DESTDIR)$(includedir)/ $(DESTDIR)$(libdir)/ $(DESTDIR)$(bindir)/ | ||
$(Q)$(INSTALL_DATA) liblz4.pc $(DESTDIR)$(pkgconfigdir)/ | ||
@echo Installing libraries | ||
ifeq ($(BUILD_STATIC),yes) | ||
ifeq ($(BUILD_STATIC),yes) | ||
$(Q)$(INSTALL_DATA) liblz4.a $(DESTDIR)$(libdir)/liblz4.a | ||
$(Q)$(INSTALL_DATA) lz4frame_static.h $(DESTDIR)$(includedir)/lz4frame_static.h | ||
endif | ||
ifeq ($(BUILD_SHARED),yes) | ||
endif | ||
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. | ||
ifeq ($(WINBASED),yes) | ||
ifeq ($(WINBASED),yes) | ||
$(Q)$(INSTALL_PROGRAM) dll/$(LIBLZ4).dll $(DESTDIR)$(bindir) | ||
$(Q)$(INSTALL_PROGRAM) dll/$(LIBLZ4_EXP) $(DESTDIR)$(libdir) | ||
else | ||
else | ||
$(Q)$(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir) | ||
$(Q)ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR) | ||
$(Q)ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT) | ||
endif | ||
endif | ||
$(Q)$(LN_SF) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR) | ||
$(Q)$(LN_SF) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT) | ||
endif | ||
endif | ||
@echo Installing headers in $(includedir) | ||
$(Q)$(INSTALL_DATA) lz4.h $(DESTDIR)$(includedir)/lz4.h | ||
$(Q)$(INSTALL_DATA) lz4hc.h $(DESTDIR)$(includedir)/lz4hc.h | ||
|
@@ -197,14 +200,14 @@ endif | |
|
||
uninstall: | ||
$(Q)$(RM) $(DESTDIR)$(pkgconfigdir)/liblz4.pc | ||
ifeq (WINBASED,1) | ||
ifeq (WINBASED,1) | ||
$(Q)$(RM) $(DESTDIR)$(bindir)/$(LIBLZ4).dll | ||
$(Q)$(RM) $(DESTDIR)$(libdir)/$(LIBLZ4_EXP) | ||
else | ||
else | ||
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT) | ||
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_MAJOR) | ||
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.$(SHARED_EXT_VER) | ||
endif | ||
endif | ||
$(Q)$(RM) $(DESTDIR)$(libdir)/liblz4.a | ||
$(Q)$(RM) $(DESTDIR)$(includedir)/lz4.h | ||
$(Q)$(RM) $(DESTDIR)$(includedir)/lz4hc.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <windows.h> | ||
|
||
// DLL version information. | ||
1 VERSIONINFO | ||
FILEVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 | ||
PRODUCTVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 | ||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK | ||
#ifdef _DEBUG | ||
FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE | ||
#else | ||
FILEFLAGS 0 | ||
#endif | ||
FILEOS VOS_NT_WINDOWS32 | ||
FILETYPE VFT_DLL | ||
FILESUBTYPE VFT2_UNKNOWN | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "040904B0" | ||
BEGIN | ||
VALUE "CompanyName", "Yann Collet" | ||
VALUE "FileDescription", "Extremely fast compression" | ||
VALUE "FileVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@[email protected]" | ||
VALUE "InternalName", "@LIBLZ4@" | ||
VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" | ||
VALUE "OriginalFilename", "@[email protected]" | ||
VALUE "ProductName", "LZ4" | ||
VALUE "ProductVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@[email protected]" | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x0409, 1200 | ||
END | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
1 VERSIONINFO | ||
FILEVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 | ||
PRODUCTVERSION @LIBVER_MAJOR@,@LIBVER_MINOR@,@LIBVER_PATCH@,0 | ||
FILEFLAGSMASK 0 | ||
FILEOS 0x40000 | ||
FILETYPE 1 | ||
{ | ||
BLOCK "StringFileInfo" | ||
{ | ||
BLOCK "040904B0" | ||
{ | ||
VALUE "CompanyName", "Yann Collet" | ||
VALUE "FileDescription", "Extremely fast compression" | ||
VALUE "FileVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@[email protected]" | ||
VALUE "InternalName", "@PROGNAME@" | ||
VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" | ||
VALUE "OriginalFilename", "@PROGNAME@.@EXT@" | ||
VALUE "ProductName", "LZ4" | ||
VALUE "ProductVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@[email protected]" | ||
} | ||
} | ||
BLOCK "VarFileInfo" | ||
{ | ||
VALUE "Translation", 0x0409, 1200 | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters