Merge pull request #2423 from facebook/no-ln
replace links by actual copies
This commit is contained in:
+2
-2
@@ -243,7 +243,7 @@ $(ZSTD_STATLIB): $(ZSTD_STATLIB_OBJ)
|
|||||||
$(AR) $(ARFLAGS) $@ $^
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
libzstd.a: $(ZSTD_STATLIB)
|
libzstd.a: $(ZSTD_STATLIB)
|
||||||
ln -sf $< $@
|
cp -f $< $@
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ $(ZSTD_DYNLIB): $(ZSTD_DYNLIB_OBJ)
|
|||||||
ln -sf $@ libzstd.$(SHARED_EXT)
|
ln -sf $@ libzstd.$(SHARED_EXT)
|
||||||
|
|
||||||
$(LIBZSTD): $(ZSTD_DYNLIB)
|
$(LIBZSTD): $(ZSTD_DYNLIB)
|
||||||
ln -sf $< $@
|
cp -f $< $@
|
||||||
|
|
||||||
endif # ifndef BUILD_DIR
|
endif # ifndef BUILD_DIR
|
||||||
endif # if windows
|
endif # if windows
|
||||||
|
|||||||
+17
-6
@@ -98,8 +98,6 @@ ZSTD_ALL_SRC := $(ZSTDLIB_LOCAL_SRC) $(ZSTD_CLI_SRC)
|
|||||||
ZSTD_ALL_OBJ := $(ZSTD_ALL_SRC:.c=.o)
|
ZSTD_ALL_OBJ := $(ZSTD_ALL_SRC:.c=.o)
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
ifndef BUILD_DIR
|
|
||||||
ifeq ($(UNAME), Darwin)
|
ifeq ($(UNAME), Darwin)
|
||||||
HASH ?= md5
|
HASH ?= md5
|
||||||
else ifeq ($(UNAME), FreeBSD)
|
else ifeq ($(UNAME), FreeBSD)
|
||||||
@@ -108,9 +106,10 @@ else ifeq ($(UNAME), OpenBSD)
|
|||||||
HASH ?= md5
|
HASH ?= md5
|
||||||
endif
|
endif
|
||||||
HASH ?= md5sum
|
HASH ?= md5sum
|
||||||
|
|
||||||
HASH_DIR = conf_$(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | cut -f 1 -d " ")
|
|
||||||
HAVE_HASH :=$(shell echo 1 | $(HASH) > /dev/null && echo 1 || echo 0)
|
HAVE_HASH :=$(shell echo 1 | $(HASH) > /dev/null && echo 1 || echo 0)
|
||||||
|
|
||||||
|
ifndef BUILD_DIR
|
||||||
|
HASH_DIR = conf_$(shell echo $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ZSTD_FILES) | $(HASH) | cut -f 1 -d " ")
|
||||||
ifeq ($(HAVE_HASH),0)
|
ifeq ($(HAVE_HASH),0)
|
||||||
$(info warning : could not find HASH ($(HASH)), needed to differentiate builds using different flags)
|
$(info warning : could not find HASH ($(HASH)), needed to differentiate builds using different flags)
|
||||||
BUILD_DIR := obj/generic_noconf
|
BUILD_DIR := obj/generic_noconf
|
||||||
@@ -232,9 +231,21 @@ $(BUILD_DIR)/zstd : $(ZSTD_OBJ)
|
|||||||
@echo LINK $@
|
@echo LINK $@
|
||||||
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
|
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
|
||||||
|
|
||||||
|
ifeq ($(HAVE_HASH),1)
|
||||||
|
SRCBIN_HASH = $(shell cat $(BUILD_DIR)/zstd 2> $(VOID) | $(HASH) | cut -f 1 -d " ")
|
||||||
|
DSTBIN_HASH = $(shell cat zstd 2> $(VOID) | $(HASH) | cut -f 1 -d " ")
|
||||||
|
BIN_ISDIFFERENT = $(if $(filter $(SRCBIN_HASH),$(DSTBIN_HASH)),0,1)
|
||||||
|
else
|
||||||
|
BIN_ISDIFFERENT = 1
|
||||||
|
endif
|
||||||
|
|
||||||
zstd : $(BUILD_DIR)/zstd
|
zstd : $(BUILD_DIR)/zstd
|
||||||
ln -sf $< $@
|
if [ $(BIN_ISDIFFERENT) -eq 1 ]; then \
|
||||||
@echo zstd build completed
|
cp -f $< $@; \
|
||||||
|
echo zstd build completed; \
|
||||||
|
else \
|
||||||
|
echo zstd already built; \
|
||||||
|
fi
|
||||||
|
|
||||||
endif # BUILD_DIR
|
endif # BUILD_DIR
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user