minor cleaning

This commit is contained in:
Yann Collet
2020-10-21 03:22:27 -07:00
parent 911dbdbb4b
commit 3e519be965
+13 -12
View File
@@ -42,12 +42,12 @@ ifneq ($(ZSTD_LIB_MINIFY), 0)
ZSTD_FORCE_DECOMPRESS_SHORT ?= 1 ZSTD_FORCE_DECOMPRESS_SHORT ?= 1
ZSTD_NO_INLINE ?= 1 ZSTD_NO_INLINE ?= 1
ZSTD_STRIP_ERROR_STRINGS ?= 1 ZSTD_STRIP_ERROR_STRINGS ?= 1
ifneq ($(HAVE_CC_OZ), 0) ifneq ($(HAVE_CC_OZ), 0)
# Some compilers (clang) support an even more space-optimized setting. # Some compilers (clang) support an even more space-optimized setting.
CFLAGS += -Oz CFLAGS += -Oz
else else
CFLAGS += -Os CFLAGS += -Os
endif endif
CFLAGS += -fno-stack-protector -fomit-frame-pointer -fno-ident \ CFLAGS += -fno-stack-protector -fomit-frame-pointer -fno-ident \
-DDYNAMIC_BMI2=0 -DNDEBUG -DDYNAMIC_BMI2=0 -DNDEBUG
else else
@@ -56,7 +56,7 @@ endif
CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_ CPPFLAGS+= -DXXH_NAMESPACE=ZSTD_
ifeq ($(TARGET_SYSTEM),Windows_NT) # MinGW assumed ifeq ($(TARGET_SYSTEM),Windows_NT) # MinGW assumed
CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting CPPFLAGS += -D__USE_MINGW_ANSI_STDIO # compatibility with %zu formatting
endif endif
DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
-Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \ -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
@@ -69,7 +69,7 @@ FLAGS = $(CPPFLAGS) $(CFLAGS)
HAVE_COLORNEVER = $(shell echo a | grep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) HAVE_COLORNEVER = $(shell echo a | grep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
GREP_OPTIONS ?= GREP_OPTIONS ?=
ifeq ($HAVE_COLORNEVER, 1) ifeq ($HAVE_COLORNEVER, 1)
GREP_OPTIONS += --color=never GREP_OPTIONS += --color=never
endif endif
GREP = grep $(GREP_OPTIONS) GREP = grep $(GREP_OPTIONS)
SED_ERE_OPT ?= -E SED_ERE_OPT ?= -E
@@ -164,7 +164,8 @@ endif
endif endif
CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
ZSTD_OBJ := $(ZSTD_FILES:.c=.o) ZSTD_FULL_OBJ := $(ZSTD_FILES:.c=.o)
ZSTD_LOCAL_OBJ := $(notdir $(ZSTD_FULL_OBJ))
vpath %.c ./common vpath %.c ./common
vpath %.c ./compress vpath %.c ./compress
@@ -173,7 +174,7 @@ vpath %.c ./dictBuilder
vpath %.c ./legacy vpath %.c ./legacy
vpath %.c ./deprecated vpath %.c ./deprecated
ZSTD_DYNLIB_OBJ := $(notdir $(ZSTD_OBJ)) ZSTD_DYNLIB_OBJ := $(ZSTD_LOCAL_OBJ)
# macOS linker doesn't support -soname, and use different extension # macOS linker doesn't support -soname, and use different extension
# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html # see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
@@ -200,7 +201,7 @@ lib-all: all
all: lib all: lib
libzstd.a: ARFLAGS = rcs libzstd.a: ARFLAGS = rcs
libzstd.a: $(ZSTD_OBJ) libzstd.a: $(ZSTD_FULL_OBJ)
@echo compiling static library @echo compiling static library
$(Q)$(AR) $(ARFLAGS) $@ $^ $(Q)$(AR) $(ARFLAGS) $@ $^
@@ -300,15 +301,15 @@ endif
endif endif
ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly)) ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
else else
PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
endif endif
ifneq (,$(filter $(shell uname),SunOS)) ifneq (,$(filter $(shell uname),SunOS))
INSTALL ?= ginstall INSTALL ?= ginstall
else else
INSTALL ?= install INSTALL ?= install
endif endif
INSTALL_PROGRAM ?= $(INSTALL) INSTALL_PROGRAM ?= $(INSTALL)