Author: Andreas Tille <tille@debian.org>
LastChanges: Wed, 13 Nov 2013 14:29:31 +0100
Description: Propagate hardening options

--- a/src/Makefile
+++ b/src/Makefile
@@ -7,11 +7,11 @@
 CC            = gcc
 CXX           = g++
 DEFINES       = 
-CFLAGS        = -m64 -pipe -O3 $(DEFINES)
-CXXFLAGS      = -m64 -pipe -O3 $(DEFINES)
+CFLAGS       += -pipe -O3 $(DEFINES)
+CXXFLAGS     += -pipe -O3 $(DEFINES)
 INCPATH       = -I. -I/usr/include
 LINK          = g++
-LFLAGS        = -m64
+#LFLAGS        = -m64
 LIBS          = $(SUBLIBS)    
 AR            = ar cqs
 RANLIB        = 
@@ -116,19 +116,19 @@
 .SUFFIXES: .o .c .cpp .cc .cxx .C
 
 .cpp.o:
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 
 .cc.o:
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 
 .cxx.o:
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 
 .C.o:
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 
 .c.o:
-	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(INCPATH) -o "$@" "$<"
 
 ####### Build rules
 
@@ -136,7 +136,7 @@
 all: Makefile $(TARGET) $(MANPAGES)
 
 $(TARGET):  $(OBJECTS)  
-	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) $(LDFLAGS)
 
 
 clean:compiler_clean 
@@ -167,7 +167,7 @@
 		dbmatrix.h \
 		boolmatrix.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o writefile.o writefile.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o writefile.o writefile.cpp
 
 treenode.o: treenode.cpp config.h \
 		hmmodel.h \
@@ -187,7 +187,7 @@
 		fullprobability.h \
 		postprobability.h \
 		characterprobability.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o treenode.o treenode.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o treenode.o treenode.cpp
 
 translatesequences.o: translatesequences.cpp translatesequences.h \
 		config.h \
@@ -201,7 +201,7 @@
 		site.h \
 		boolmatrix.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o translatesequences.o translatesequences.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o translatesequences.o translatesequences.cpp
 
 terminalsequence.o: terminalsequence.cpp terminalsequence.h \
 		sequence.h \
@@ -215,7 +215,7 @@
 		ancestralnode.h \
 		treenode.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o terminalsequence.o terminalsequence.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o terminalsequence.o terminalsequence.cpp
 
 terminalnode.o: terminalnode.cpp terminalnode.h \
 		treenode.h \
@@ -230,7 +230,7 @@
 		hmmodel.h \
 		ancestralnode.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o terminalnode.o terminalnode.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o terminalnode.o terminalnode.cpp
 
 site.o: site.cpp site.h \
 		intmatrix.h \
@@ -242,7 +242,7 @@
 		treenode.h \
 		sequence.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o site.o site.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o site.o site.cpp
 
 sequence.o: sequence.cpp sequence.h \
 		site.h \
@@ -250,7 +250,7 @@
 		flmatrix.h \
 		dbmatrix.h \
 		boolmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o sequence.o sequence.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o sequence.o sequence.cpp
 
 readnewick.o: readnewick.cpp readnewick.h \
 		treenode.h \
@@ -263,10 +263,10 @@
 		ancestralnode.h \
 		ancestralsequence.h \
 		node.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o readnewick.o readnewick.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o readnewick.o readnewick.cpp
 
 readfile.o: readfile.cpp readfile.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o readfile.o readfile.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o readfile.o readfile.cpp
 
 readalignment.o: readalignment.cpp readalignment.h \
 		sequence.h \
@@ -282,12 +282,12 @@
 		config.h \
 		hmmodel.h \
 		ancestralnode.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o readalignment.o readalignment.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o readalignment.o readalignment.cpp
 
 pwsite.o: pwsite.cpp pwsite.h \
 		flmatrix.h \
 		intmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o pwsite.o pwsite.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o pwsite.o pwsite.cpp
 
 pwhirschberg.o: pwhirschberg.cpp config.h \
 		hmmodel.h \
@@ -303,7 +303,7 @@
 		pwhirschberg.h \
 		pwsite.h \
 		exonerate_reads.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o pwhirschberg.o pwhirschberg.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o pwhirschberg.o pwhirschberg.cpp
 
 progressivealignment.o: progressivealignment.cpp readnewick.h \
 		treenode.h \
@@ -330,7 +330,7 @@
 		readalignment.h \
 		exonerate_reads.h \
 		bppancestors.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o progressivealignment.o progressivealignment.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o progressivealignment.o progressivealignment.cpp
 
 prank.o: prank.cpp progressivealignment.h \
 		config.h \
@@ -353,7 +353,7 @@
 		mafft_alignment.h \
 		check_version.h \
 		prank.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o prank.o prank.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o prank.o prank.cpp
 
 postprobability.o: postprobability.cpp config.h \
 		hmmodel.h \
@@ -369,7 +369,7 @@
 		postprobability.h \
 		phylomatchscore.h \
 		terminalsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o postprobability.o postprobability.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o postprobability.o postprobability.cpp
 
 phylomatchscore.o: phylomatchscore.cpp config.h \
 		hmmodel.h \
@@ -384,13 +384,13 @@
 		ancestralsequence.h \
 		phylomatchscore.h \
 		terminalsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o phylomatchscore.o phylomatchscore.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o phylomatchscore.o phylomatchscore.cpp
 
 node.o: node.cpp node.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o node.o node.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o node.o node.cpp
 
 intmatrix.o: intmatrix.cpp intmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o intmatrix.o intmatrix.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o intmatrix.o intmatrix.cpp
 
 hmmodel.o: hmmodel.cpp hmmodel.h \
 		dbmatrix.h \
@@ -403,7 +403,7 @@
 		boolmatrix.h \
 		ancestralsequence.h \
 		eigen.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o hmmodel.o hmmodel.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o hmmodel.o hmmodel.cpp
 
 hirschberg.o: hirschberg.cpp config.h \
 		hmmodel.h \
@@ -420,7 +420,7 @@
 		hirschberg.h \
 		phylomatchscore.h \
 		terminalsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o hirschberg.o hirschberg.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o hirschberg.o hirschberg.cpp
 
 guidetree.o: guidetree.cpp guidetree.h \
 		flmatrix.h \
@@ -437,7 +437,7 @@
 		boolmatrix.h \
 		ancestralsequence.h \
 		translatesequences.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o guidetree.o guidetree.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o guidetree.o guidetree.cpp
 
 fullprobability.o: fullprobability.cpp config.h \
 		hmmodel.h \
@@ -453,16 +453,16 @@
 		fullprobability.h \
 		phylomatchscore.h \
 		terminalsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o fullprobability.o fullprobability.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o fullprobability.o fullprobability.cpp
 
 flmatrix.o: flmatrix.cpp flmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o flmatrix.o flmatrix.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o flmatrix.o flmatrix.cpp
 
 eigen.o: eigen.cpp eigen.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o eigen.o eigen.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o eigen.o eigen.cpp
 
 dbmatrix.o: dbmatrix.cpp dbmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o dbmatrix.o dbmatrix.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o dbmatrix.o dbmatrix.cpp
 
 characterprobability.o: characterprobability.cpp config.h \
 		hmmodel.h \
@@ -477,10 +477,10 @@
 		ancestralsequence.h \
 		characterprobability.h \
 		terminalsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o characterprobability.o characterprobability.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o characterprobability.o characterprobability.cpp
 
 boolmatrix.o: boolmatrix.cpp boolmatrix.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o boolmatrix.o boolmatrix.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o boolmatrix.o boolmatrix.cpp
 
 ancestralsequence.o: ancestralsequence.cpp ancestralsequence.h \
 		sequence.h \
@@ -493,7 +493,7 @@
 		hmmodel.h \
 		ancestralnode.h \
 		treenode.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ancestralsequence.o ancestralsequence.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o ancestralsequence.o ancestralsequence.cpp
 
 ancestralnode.o: ancestralnode.cpp config.h \
 		hmmodel.h \
@@ -515,10 +515,10 @@
 		characterprobability.h \
 		terminalnode.h \
 		readalignment.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o ancestralnode.o ancestralnode.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o ancestralnode.o ancestralnode.cpp
 
 check_version.o: check_version.cpp check_version.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o check_version.o check_version.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o check_version.o check_version.cpp
 
 exonerate_reads.o: exonerate_reads.cpp exonerate_reads.h \
 		config.h \
@@ -533,7 +533,7 @@
 		boolmatrix.h \
 		ancestralsequence.h \
 		translatesequences.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o exonerate_reads.o exonerate_reads.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o exonerate_reads.o exonerate_reads.cpp
 
 mafft_alignment.o: mafft_alignment.cpp mafft_alignment.h \
 		config.h \
@@ -547,7 +547,7 @@
 		site.h \
 		boolmatrix.h \
 		ancestralsequence.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mafft_alignment.o mafft_alignment.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o mafft_alignment.o mafft_alignment.cpp
 
 bppancestors.o: bppancestors.cpp bppancestors.h \
 		ancestralnode.h \
@@ -563,7 +563,7 @@
 		hmmodel.h \
 		readfile.h \
 		readnewick.h
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o bppancestors.o bppancestors.cpp
+	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(INCPATH) -o bppancestors.o bppancestors.cpp
 
 ####### Manpages
 
