make zstd is now differentiated from zstd-nomt

avoids mixing object files using different flags
This commit is contained in:
Yann Collet
2020-10-23 16:08:21 -07:00
parent 89b961ea46
commit a6ee614a44
2 changed files with 35 additions and 22 deletions
+5 -6
View File
@@ -182,15 +182,14 @@ BUILD_DIR ?= 0
ifeq ($(BUILD_DIR),0)
ifeq ($(UNAME), Darwin)
HASH ?= md5
endif
ifeq ($(UNAME), FreeBSD)
else ifeq ($(UNAME), FreeBSD)
HASH ?= gmd5sum
endif
ifeq ($(UNAME), OpenBSD)
else ifeq ($(UNAME), OpenBSD)
HASH ?= md5
endif
HASH ?= md5sum
HASH_DIR = conf_$(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | head -c 16)
HAVE_HASH :=$(shell echo 1 | $(HASH) > /dev/null && echo 1 || echo 0)
ifeq ($(HAVE_HASH),0)
$(info warning : could not find HASH ($(HASH)), needed to differentiate builds using different flags)
@@ -229,7 +228,7 @@ ifeq ($(BUILD_DIR),0)
.PHONY: libzstd.a # not the actual recipe
libzstd.a:
$(MAKE) --no-print-directory $@ \
BUILD_DIR=obj/conf_$(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | head -c 16) \
BUILD_DIR=obj/$(HASH_DIR) \
CPPFLAGS="$(CPPFLAGS)"
else
@@ -269,7 +268,7 @@ ifeq ($(BUILD_DIR),0)
.PHONY: $(LIBZSTD) # not the actual recipe
$(LIBZSTD):
$(MAKE) --no-print-directory $@ \
BUILD_DIR=obj/conf_$(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | head -c 16) \
BUILD_DIR=obj/$(HASH_DIR) \
CPPFLAGS="$(CPPFLAGS)" \
CFLAGS="$(CFLAGS)" \
LDFLAGS="$(LDFLAGS)"