diff options
author | Yann Collet <cyan@fb.com> | 2016-12-22 17:02:09 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2016-12-22 17:02:09 (GMT) |
commit | 19c0f21b000ababf11cb38e0d6154742f5e1cd83 (patch) | |
tree | 07257e454c97b2ee3b5e99c4e29ffe3caec80414 /programs | |
parent | b41f9bb132e8207999e89d01925e202da98b7649 (diff) | |
download | lz4-19c0f21b000ababf11cb38e0d6154742f5e1cd83.zip lz4-19c0f21b000ababf11cb38e0d6154742f5e1cd83.tar.gz lz4-19c0f21b000ababf11cb38e0d6154742f5e1cd83.tar.bz2 |
updated Makefile : lz4 no longer recompiled when already up-to-date
Diffstat (limited to 'programs')
-rw-r--r-- | programs/Makefile | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/programs/Makefile b/programs/Makefile index 74a2440..6f4c8c2 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -43,7 +43,9 @@ PREFIX ?= /usr/local BINDIR := $(PREFIX)/bin MANDIR := $(PREFIX)/share/man/man1 LZ4DIR := ../lib -VOID := /dev/null + +SRCFILES := $(wildcard $(LZ4DIR)/*.c) $(wildcard *.c) +OBJFILES := $(patsubst %.c,%.o,$(SRCFILES)) CPPFLAGS+= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 @@ -60,33 +62,36 @@ MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 # Define *.exe as extension for Windows systems ifneq (,$(filter Windows%,$(OS))) -EXT =.exe +VOID := nul +EXT :=.exe else -EXT = +VOID := /dev/null +EXT := endif default: lz4-release -lz4-release: $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.o datagen.o - $(CC) $(FLAGS) $^ -o lz4$(EXT) - all: lz4 lz4c all32: CFLAGS+=-m32 all32: all lz4: CFLAGS += $(DEBUGFLAGS) -lz4: lz4-release +lz4: $(OBJFILES) + $(CC) $(FLAGS) $^ -o $@$(EXT) + +lz4-release: DEBUGFLAGS= +lz4-release: lz4 -lz4c: CFLAGS += $(DEBUGFLAGS) -lz4c : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o bench.o lz4io.o lz4cli.c datagen.o +lz4c : CFLAGS += $(DEBUGFLAGS) +lz4c : $(SRCFILES) $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) -lz4c32: CFLAGS+=-m32 -lz4c32: lz4 - @cp lz4$(EXT) lz4c32$(EXT) +lz4c32: CFLAGS += -m32 $(DEBUGFLAGS) +lz4c32: $(SRCFILES) + $(CC) $(FLAGS) $^ -o $@$(EXT) clean: @$(MAKE) -C $(LZ4DIR) $@ > $(VOID) |