]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
release builds use less debug symbols and warnings
authorYann Collet <cyan@fb.com>
Fri, 3 Feb 2017 04:54:14 +0000 (20:54 -0800)
committerYann Collet <cyan@fb.com>
Fri, 3 Feb 2017 04:54:41 +0000 (20:54 -0800)
release build are triggered through either `make`,
or their specific target `make zstd-release` and `make lib-release`.

Makefile
lib/Makefile
programs/Makefile

index 14d1510ab02cdd867c3338cb1bae33233d5f4ee1..d86db7cb322f3b847d27995891696265111d9874 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ EXT =
 endif
 
 .PHONY: default
-default: lib zstd
+default: lib zstd-release
 
 .PHONY: all
 all: allmost
@@ -50,6 +50,11 @@ zstd:
        @$(MAKE) -C $(PRGDIR) $@
        cp $(PRGDIR)/zstd$(EXT) .
 
+.PHONY: zstd-release
+zstd-release:
+       @$(MAKE) -C $(PRGDIR)
+       cp $(PRGDIR)/zstd$(EXT) .
+
 .PHONY: zstdmt
 zstdmt:
        @$(MAKE) -C $(PRGDIR) $@
index c4a5ecb910cc2c4f83fae99460d5d368859e3e00..bef69543fce7336746562bdc045f638d9b4fb8ff 100644 (file)
@@ -22,10 +22,10 @@ VERSION?= $(LIBVER)
 
 CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_
 CFLAGS  ?= -O3
-CFLAGS  += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
-           -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \
-           -Wpointer-arith
-CFLAGS  += $(MOREFLAGS)
+DEBUGFLAGS = -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
+           -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+           -Wstrict-prototypes -Wundef -Wpointer-arith
+CFLAGS  += $(DEBUGFLAGS) $(MOREFLAGS)
 FLAGS    = $(CPPFLAGS) $(CFLAGS)
 
 
@@ -59,7 +59,7 @@ LIBZSTD = libzstd.$(SHARED_EXT_VER)
 
 .PHONY: default all clean install uninstall
 
-default: lib
+default: lib-release
 
 all: lib
 
@@ -85,6 +85,9 @@ libzstd : $(LIBZSTD)
 
 lib: libzstd.a libzstd
 
+lib-release: DEBUGFLAGS :=
+lib-release: lib
+
 clean:
        @$(RM) core *.o *.a *.gcda *.$(SHARED_EXT) *.$(SHARED_EXT).* libzstd.pc dll/libzstd.dll dll/libzstd.lib
        @$(RM) common/*.o compress/*.o decompress/*.o dictBuilder/*.o legacy/*.o deprecated/*.o
index fce47b12ea3065c9d546aa3790352b8e5954c77d..ce90bd457cd8abbc8fc0f7f83c822e6dbf17022a 100644 (file)
@@ -26,10 +26,10 @@ endif
 
 CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress -I$(ZSTDDIR)/dictBuilder
 CFLAGS  ?= -O3
-CFLAGS  += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
-          -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \
-          -Wpointer-arith
-CFLAGS  += $(MOREFLAGS)
+DEBUGFLAGS = -g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \
+          -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
+          -Wstrict-prototypes -Wundef -Wpointer-arith
+CFLAGS  += $(DEBUGFLAGS) $(MOREFLAGS)
 FLAGS    = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
 
 
@@ -74,7 +74,7 @@ endif
 
 .PHONY: default all clean clean_decomp_o install uninstall generate_res
 
-default: zstd
+default: zstd-release
 
 all: zstd
 
@@ -92,12 +92,15 @@ ifneq (,$(filter Windows%,$(OS)))
 endif
        $(CC) $(FLAGS) $^ $(RES_FILE) -o zstd$(EXT) $(LDFLAGS)
 
+zstd-nogz : HAVE_ZLIB=0
+zstd-nogz : zstd-internal
+
 zstd : CPPFLAGS += $(ZLIBCPP)
 zstd : LDFLAGS += $(ZLIBLD)
 zstd : zstd-internal
 
-zstd-nogz : HAVE_ZLIB=0
-zstd-nogz : zstd-internal
+zstd-release: DEBUGFLAGS :=
+zstd-release: zstd
 
 zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
 zstd32 : $(ZSTDLIB_FILES) zstdcli.c fileio.c bench.c datagen.c dibio.c