diff options
author | Yann Collet <cyan@fb.com> | 2020-12-01 00:06:50 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-12-01 00:06:50 (GMT) |
commit | e585a438c714652e866a59371b287f52aa4d2dc3 (patch) | |
tree | 33b49e2fcb8fbc90a32aa9c3f7fc16f35b2f3829 /programs | |
parent | 87a80acbe7872b9da7d56f7005ffd1b715e87c93 (diff) | |
download | lz4-e585a438c714652e866a59371b287f52aa4d2dc3.zip lz4-e585a438c714652e866a59371b287f52aa4d2dc3.tar.gz lz4-e585a438c714652e866a59371b287f52aa4d2dc3.tar.bz2 |
refactor Makefile
remove usage of include Makefile.inc in too Makefile
as it seems to somehow unexport CFLAGS ...
Diffstat (limited to 'programs')
-rw-r--r-- | programs/Makefile | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/programs/Makefile b/programs/Makefile index 594be55..cd274c0 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -28,13 +28,14 @@ # lz4c : CLU, supporting also legacy lz4demo arguments # lz4c32: Same as lz4c, but forced to compile in 32-bits mode # ########################################################################## +SED = sed # Version numbers LZ4DIR := ../lib LIBVER_SRC := $(LZ4DIR)/lz4.h -LIBVER_MAJOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` -LIBVER_MINOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` -LIBVER_PATCH_SCRIPT:=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` +LIBVER_MAJOR_SCRIPT:=`$(SED) -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` +LIBVER_MINOR_SCRIPT:=`$(SED) -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` +LIBVER_PATCH_SCRIPT:=`$(SED) -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LIBVER_SRC)` LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT) LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT)) LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) @@ -61,6 +62,9 @@ include ../Makefile.inc default: lz4-release +# silent mode by default; verbose can be triggered by V=1 or VERBOSE=1 +$(V)$(VERBOSE).SILENT: + all: lz4 lz4c all32: CFLAGS+=-m32 @@ -69,7 +73,7 @@ all32: all ifeq ($(WINBASED),yes) lz4-exe.rc: lz4-exe.rc.in @echo creating executable resource - $(Q)sed -e 's|@PROGNAME@|lz4|' \ + $(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' \ @@ -110,7 +114,7 @@ lz4c32 : $(SRCFILES) $(CC) $(FLAGS) $^ -o $@$(EXT) lz4.1: lz4.1.md $(LIBVER_SRC) - cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@ + cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | $(SED) -n '/^\.\\\".*/!p' > $@ man: lz4.1 @@ -122,10 +126,10 @@ preview-man: clean-man man clean: ifeq ($(WINBASED),yes) - $(Q)$(RM) *.rc + $(RM) *.rc endif - @$(MAKE) -C $(LZ4DIR) $@ > $(VOID) - @$(RM) core *.o *.test tmp* \ + $(MAKE) -C $(LZ4DIR) $@ > $(VOID) + $(RM) core *.o *.test tmp* \ lz4$(EXT) lz4c$(EXT) lz4c32$(EXT) lz4-wlib$(EXT) \ unlz4$(EXT) lz4cat$(EXT) @echo Cleaning completed @@ -161,27 +165,27 @@ man1dir ?= $(MAN1DIR) install: lz4 @echo Installing binaries - @$(INSTALL_DIR) $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/ - @$(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(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) + $(INSTALL_DIR) $(DESTDIR)$(bindir)/ $(DESTDIR)$(man1dir)/ + $(INSTALL_PROGRAM) lz4$(EXT) $(DESTDIR)$(bindir)/lz4$(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 + $(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 @echo lz4 installation completed uninstall: - @$(RM) $(DESTDIR)$(bindir)/lz4cat$(EXT) - @$(RM) $(DESTDIR)$(bindir)/unlz4$(EXT) - @$(RM) $(DESTDIR)$(bindir)/lz4$(EXT) - @$(RM) $(DESTDIR)$(bindir)/lz4c$(EXT) - @$(RM) $(DESTDIR)$(man1dir)/lz4.1 - @$(RM) $(DESTDIR)$(man1dir)/lz4c.1 - @$(RM) $(DESTDIR)$(man1dir)/lz4cat.1 - @$(RM) $(DESTDIR)$(man1dir)/unlz4.1 + $(RM) $(DESTDIR)$(bindir)/lz4cat$(EXT) + $(RM) $(DESTDIR)$(bindir)/unlz4$(EXT) + $(RM) $(DESTDIR)$(bindir)/lz4$(EXT) + $(RM) $(DESTDIR)$(bindir)/lz4c$(EXT) + $(RM) $(DESTDIR)$(man1dir)/lz4.1 + $(RM) $(DESTDIR)$(man1dir)/lz4c.1 + $(RM) $(DESTDIR)$(man1dir)/lz4cat.1 + $(RM) $(DESTDIR)$(man1dir)/unlz4.1 @echo lz4 programs successfully uninstalled endif |