From 684f8ea970f15a19f82728d596ecfbf509ea686f Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 20 Oct 2020 18:16:11 -0700 Subject: [PATCH] decouple zstd object files from lib/ That was a subtle one : VPATH is affecting search for both %.c source and %.o object files. This meant that, when an object file already exists in lib/, it's used in programs/, even though programs/ is supposed to generate its own %.o object files. With the new vpath directive, this is no longer the case : the search is only activated for %.c source files. Now, local programs/%.o are always generated even if equivalent ones are already created in lib/. It more clearly guarantees that lib/ and programs/ can use different compilation directives without mixing resulting %.o object files. --- programs/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 1170ccbd..8f14292f 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -65,7 +65,11 @@ ZSTDLIB_DECOMPRESS := $(ZSTDDIR)/decompress ZDICT_DIR := $(ZSTDDIR)/dictBuilder ZSTDLEGACY_DIR := $(ZSTDDIR)/legacy -VPATH := $(ZSTDLIB_COMMON):$(ZSTDLIB_COMPRESS):$(ZSTDLIB_DECOMPRESS):$(ZDICT_DIR):$(ZSTDLEGACY_DIR) +vpath %.c $(ZSTDLIB_COMMON) +vpath %.c $(ZSTDLIB_COMPRESS) +vpath %.c $(ZSTDLIB_DECOMPRESS) +vpath %.c $(ZDICT_DIR) +vpath %.c $(ZSTDLEGACY_DIR) ZSTDLIB_COMMON_C := $(wildcard $(ZSTDLIB_COMMON)/*.c) ZSTDLIB_COMPRESS_C := $(wildcard $(ZSTDLIB_COMPRESS)/*.c) @@ -284,7 +288,6 @@ endif .PHONY: clean clean: - $(MAKE) -C $(ZSTDDIR) clean $(Q)$(RM) core *.o tmp* result* *.gcda dictionary *.zst \ zstd$(EXT) zstd32$(EXT) zstd-compress$(EXT) zstd-decompress$(EXT) \ zstd-small$(EXT) zstd-frugal$(EXT) zstd-nolegacy$(EXT) zstd4$(EXT) \