1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 29 Mar 2016 22:11:29 +0200
Description: Propagate hardening options
--- a/Makefile
+++ b/Makefile
@@ -37,8 +37,9 @@
# CXX = CC -n32 -LANG:std # for SGI Irix 6.5, MIPSpro CC version 7.30
CXX = g++ # for Linux RedHat 6.1, g++ version 2.95.2
-CPPFLAGS = -I. -O
-LDFLAGS = -L. -lgzstream -lz
+CXXFLAGS+= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
+CPPFLAGS+= -I. -O
+LDFLAGS += -L. -lgzstream -lz
AR = ar cr
# ----------------------------------------------------------------------------
@@ -68,19 +69,19 @@
# *** O.K. Installation finished successfully. ***
gzstream.o : gzstream.C gzstream.h
- ${CXX} ${CPPFLAGS} -c -o gzstream.o gzstream.C
+ ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o gzstream.o gzstream.C
test_gzip.o : test_gzip.C gzstream.h
- ${CXX} ${CPPFLAGS} -c -o test_gzip.o test_gzip.C
+ ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gzip.o test_gzip.C
test_gunzip.o : test_gunzip.C gzstream.h
- ${CXX} ${CPPFLAGS} -c -o test_gunzip.o test_gunzip.C
+ ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gunzip.o test_gunzip.C
libgzstream.a : gzstream.o
${AR} libgzstream.a gzstream.o
libgzstream.so : gzstream.C gzstream.h
- ${CXX} ${CPPFLAGS} -fPIC -c -o gzstream.o gzstream.C
+ ${CXX} ${CPPFLAGS} ${CXXFLAGS} -fPIC -c -o gzstream.o gzstream.C
${CXX} ${LDFLAGS} -shared -Wl,-soname,$@.$(SOVERSION) -o $@.$(SOVERSION) gzstream.o
ln -s $@.$(SOVERSION) $@
|