diff --git a/.circleci/config.yml b/.circleci/config.yml index 9738c1bd..4529743e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,9 +31,9 @@ jobs: command: | make gnu90build; make clean make gnu99build; make clean - make ppc64build; make clean - make ppcbuild ; make clean - make armbuild ; make clean + make ppc64build V=1; make clean + make ppcbuild V=1; make clean + make armbuild V=1; make clean make -C tests test-legacy test-longmatch; make clean make -C lib libzstd-nomt; make clean # This step is only run on release tags. diff --git a/.github/workflows/generic-dev.yml b/.github/workflows/generic-dev.yml index 621aea32..fab0f2da 100644 --- a/.github/workflows/generic-dev.yml +++ b/.github/workflows/generic-dev.yml @@ -72,7 +72,7 @@ jobs: make gcc8install CC=gcc-8 CFLAGS="-Werror" make -j all make clean - CC=gcc-8 make -j uasan-test-zstd $@ +.PHONY: install install: install-pc install-static install-shared install-includes @echo zstd static and shared library installed @@ -437,6 +436,7 @@ install-includes: $(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) $(INSTALL_DATA) dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR) +.PHONY: uninstall uninstall: $(RM) $(DESTDIR)$(LIBDIR)/libzstd.a $(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT) diff --git a/programs/Makefile b/programs/Makefile index 8641d0ee..e66d182f 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -61,8 +61,10 @@ DEBUGFLAGS+=-Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-prototypes -Wundef -Wpointer-arith \ -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ -Wredundant-decls -Wmissing-prototypes -Wc++-compat -CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +CFLAGS += $(DEBUGFLAGS) +CPPFLAGS += $(MOREFLAGS) +LDFLAGS += $(MOREFLAGS) +FLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ZSTDLIB_COMMON := $(ZSTDDIR)/common ZSTDLIB_COMPRESS := $(ZSTDDIR)/compress @@ -196,7 +198,8 @@ SET_CACHE_DIRECTORY = \ BUILD_DIR=obj/$(HASH_DIR) \ CPPFLAGS="$(CPPFLAGS)" \ CFLAGS="$(CFLAGS)" \ - LDFLAGS="$(LDFLAGS)" + LDFLAGS="$(LDFLAGS)" \ + LDLIBS="$(LDLIBS)" .PHONY: all @@ -207,7 +210,8 @@ allVariants: zstd zstd-compress zstd-decompress zstd-small zstd-nolegacy zstd-di .PHONY: zstd # must always be run zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP) -zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD) +zstd : LDFLAGS += $(THREAD_LD) $(DEBUGFLAGS_LD) +zstd : LDLIBS += $(ZLIBLD) $(LZMALD) $(LZ4LD) zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) ifneq (,$(filter Windows%,$(OS))) zstd : $(RES_FILE) @@ -229,7 +233,7 @@ $(BUILD_DIR)/zstd : $(ZSTD_OBJ) @echo "$(LZMA_MSG)" @echo "$(LZ4_MSG)" @echo LINK $@ - $(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS) + $(CC) $(FLAGS) $^ $(LDLIBS) -o $@$(EXT) ifeq ($(HAVE_HASH),1) SRCBIN_HASH = $(shell cat $(BUILD_DIR)/zstd 2> $(VOID) | $(HASH) | cut -f 1 -d " ") diff --git a/tests/Makefile b/tests/Makefile index 42bc353c..1c667cf8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -38,8 +38,8 @@ CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wstrict-prototypes -Wundef \ -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ -Wredundant-decls -Wmissing-prototypes -CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +CFLAGS += $(DEBUGFLAGS) +CPPFLAGS += $(MOREFLAGS) ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c @@ -107,7 +107,6 @@ libzstd : %-dll : libzstd %-dll : LDFLAGS += -L$(ZSTDDIR) -lzstd -.PHONY: $(ZSTDDIR)/libzstd.a $(ZSTDDIR)/libzstd.a : $(MAKE) -C $(ZSTDDIR) libzstd.a @@ -146,7 +145,7 @@ fullbench-lib : $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR # note : broken : requires symbols unavailable from dynamic library fullbench-dll: $(PRGDIR)/datagen.c $(PRGDIR)/util.c $(PRGDIR)/benchfn.c $(PRGDIR)/timefn.c fullbench.c # $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll - $(CC) $(FLAGS) $(filter %.c,$^) -o $@$(EXT) + $(LINK.c) $^ $(LDLIBS) -o $@$(EXT) fuzzer : CPPFLAGS += $(MULTITHREAD_CPP) fuzzer : LDFLAGS += $(MULTITHREAD_LD) @@ -165,7 +164,7 @@ zbufftest zbufftest32 zbufftest-dll : CPPFLAGS += -I$(ZSTDDIR)/deprecated zbufftest zbufftest32 zbufftest-dll : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings zbufftest32 : CFLAGS += -m32 zbufftest zbufftest32 : $(ZSTD_OBJECTS) $(ZBUFF_FILES) $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c - $(CC) $(FLAGS) $^ -o $@$(EXT) + $(LINK.c) $^ -o $@$(EXT) zbufftest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/util.c $(PRGDIR)/timefn.c $(PRGDIR)/datagen.c zbufftest.c $(CC) $(CPPFLAGS) $(CFLAGS) $(filter %.c,$^) $(LDFLAGS) -o $@$(EXT)