aboutsummaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorJPeterMugaas <jpmugaas@suddenlink.net>2019-04-23 07:44:00 -0400
committerJPeterMugaas <jpmugaas@suddenlink.net>2019-04-23 07:44:00 -0400
commit7136489d336fd2e584eb13cb858983caac5ad2e8 (patch)
treefe7d22f46d7345bf1316a91c2eedad4765f997f1 /programs
parent229b016f507cdc0db300c22ac4ec8bab7cd0874f (diff)
downloadlz4-7136489d336fd2e584eb13cb858983caac5ad2e8.tar.gz
More build imrpvements
Moved a few other tests to Makefiles.inc. Other things might need to go there. Made a test for symlink appropriateness. Windows can NOT handle them the same way Unix-like operating systems do (if at all). This is mostly the same as the Visual C projects. embed version info into .dll and .exes that are redistributed.
Diffstat (limited to 'programs')
-rw-r--r--programs/Makefile53
-rw-r--r--programs/lz4-exe.rc.in27
2 files changed, 59 insertions, 21 deletions
diff --git a/programs/Makefile b/programs/Makefile
index e0554919..4994551a 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -65,14 +65,32 @@ all: lz4 lz4c
all32: CFLAGS+=-m32
all32: all
+ifeq ($(WINBASED),yes)
+lz4-exe.rc: lz4-exe.rc.in
+ @echo creating executable resource
+ $(Q)sed -e 's|@PROGNAME@|lz4|' \
+ -e 's|@LIBVER_MAJOR@|$(LIBVER_MAJOR)|g' \
+ -e 's|@LIBVER_MINOR@|$(LIBVER_MINOR)|g' \
+ -e 's|@LIBVER_PATCH@|$(LIBVER_PATCH)|g' \
+ -e 's|@EXT@|$(EXT)|g' \
+ $< >$@
+
+lz4-exe.o: lz4-exe.rc
+ $(WINDRES) -i lz4-exe.rc -o lz4-exe.o
+
+lz4: $(OBJFILES) lz4-exe.o
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
+else
lz4: $(OBJFILES)
$(CC) $(FLAGS) $^ -o $@$(EXT)
+endif
+
lz4-release: DEBUGFLAGS=
lz4-release: lz4
lz4c: lz4
- ln -s lz4$(EXT) lz4c$(EXT)
+ $(LN_SF) lz4$(EXT) lz4c$(EXT)
lz4c32: CFLAGS += -m32
lz4c32 : $(SRCFILES)
@@ -90,6 +108,9 @@ preview-man: clean-man man
man ./lz4.1
clean:
+ifeq ($(WINBASED),yes)
+ $(Q)$(RM) *.rc
+endif
@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
@$(RM) core *.o *.test tmp* \
lz4$(EXT) lz4c$(EXT) lz4c32$(EXT) unlz4$(EXT) lz4cat$(EXT)
@@ -99,13 +120,13 @@ clean:
#-----------------------------------------------------------------------------
# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW32_NT% MINGW64_NT% MSYS% CYGWIN_NT%,$(shell uname)))
+ifeq ($(POSIX_ENV),Yes)
unlz4: lz4
- ln -s lz4$(EXT) unlz4$(EXT)
+ $(LN_SF) lz4$(EXT) unlz4$(EXT)
lz4cat: lz4
- ln -s lz4$(EXT) lz4cat$(EXT)
+ $(LN_SF) lz4$(EXT) lz4cat$(EXT)
DESTDIR ?=
# directory variables : GNU conventions prefer lowercase
@@ -124,28 +145,18 @@ mandir ?= $(MANDIR)
MAN1DIR ?= $(mandir)/man1
man1dir ?= $(MAN1DIR)
-ifneq (,$(filter $(shell uname),SunOS))
-INSTALL ?= ginstall
-else
-INSTALL ?= install
-endif
-
-INSTALL_PROGRAM ?= $(INSTALL) -m 755
-INSTALL_DATA ?= $(INSTALL) -m 644
-
-
install: lz4
@echo Installing binaries
- @$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/
+ @$(INSTALL_DIR) $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/
@$(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(EXT)
- @ln -sf lz4$(EXT) $(DESTDIR)$(bindir)/lz4c$(EXT)
- @ln -sf lz4$(EXT) $(DESTDIR)$(bindir)/lz4cat$(EXT)
- @ln -sf lz4$(EXT) $(DESTDIR)$(bindir)/unlz4$(EXT)
+ @$(LN_S) lz4$(EXT) $(DESTDIR)$(bindir)/lz4c$(EXT)
+ @$(LN_S) lz4$(EXT) $(DESTDIR)$(bindir)/lz4cat$(EXT)
+ @$(LN_S) lz4$(EXT) $(DESTDIR)$(bindir)/unlz4$(EXT)
@echo Installing man pages
@$(INSTALL_DATA) lz4.1 $(DESTDIR)$(man1dir)/lz4.1
- @ln -sf lz4.1 $(DESTDIR)$(man1dir)/lz4c.1
- @ln -sf lz4.1 $(DESTDIR)$(man1dir)/lz4cat.1
- @ln -sf lz4.1 $(DESTDIR)$(man1dir)/unlz4.1
+ @$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4c.1
+ @$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/lz4cat.1
+ @$(LN_SF) lz4.1 $(DESTDIR)$(man1dir)/unlz4.1
@echo lz4 installation completed
uninstall:
diff --git a/programs/lz4-exe.rc.in b/programs/lz4-exe.rc.in
new file mode 100644
index 00000000..7b810305
--- /dev/null
+++ b/programs/lz4-exe.rc.in
@@ -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@.@LIBVER_PATCH@.0"
+ VALUE "InternalName", "@PROGNAME@"
+ VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet"
+ VALUE "OriginalFilename", "@PROGNAME@.@EXT@"
+ VALUE "ProductName", "LZ4"
+ VALUE "ProductVersion", "@LIBVER_MAJOR@.@LIBVER_MINOR@.@LIBVER_PATCH@.0"
+ }
+ }
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x0409, 1200
+ }
+}
+