aboutsummaryrefslogtreecommitdiff
path: root/src/makefile.unix
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-05-12 23:03:01 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-05-13 00:41:46 +0200
commita6cd0b08f6ef2af86fdff01154fe647e40b95424 (patch)
treef926f87143b5c79f8261e53ecd3303f78dbbc4e4 /src/makefile.unix
parent85a22292648cf64918c44b494c78574924ed7acc (diff)
Partially revert f621326: xCXXFLAGS
Diffstat (limited to 'src/makefile.unix')
-rw-r--r--src/makefile.unix15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/makefile.unix b/src/makefile.unix
index ad0a82df50..b1cc89d0cb 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -82,8 +82,11 @@ LIBS+= \
DEBUGFLAGS=-g
-CXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
- $(DEBUGFLAGS) $(DEFS) $(HARDENING)
+
+# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
+# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
+xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
+ $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
OBJS= \
obj/version.o \
@@ -121,26 +124,26 @@ version.cpp: obj/build.h
DEFS += -DHAVE_BUILD_INFO
obj/%.o: %.cpp
- $(CXX) -c $(CXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
bitcoind: $(OBJS:obj/%=obj/%)
- $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
+ $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
obj-test/%.o: test/%.cpp
- $(CXX) -c $(TESTDEFS) $(CXXFLAGS) -MMD -o $@ $<
+ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- $(CXX) $(CXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
+ $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
clean:
-rm -f bitcoind test_bitcoin