aboutsummaryrefslogtreecommitdiff
path: root/src/makefile.unix
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-12 20:02:47 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-12 20:02:47 -0500
commita1de57a063af397612bb77f87c803c578d04f8e5 (patch)
tree89195dc59b21098e0d747d88e2f4c1ee6ba9d9f0 /src/makefile.unix
parent025d495481f2313a1550d8d101415ff3e3a6b89f (diff)
Compile with extra warnings turned on. And more makefile/code tidying up.
This turns on most gcc warnings, and removes some unused variables and other code that triggers warnings. Exceptions are: -Wno-sign-compare : triggered by lots of comparisons of signed integer to foo.size(), which is unsigned. -Wno-char-subscripts : triggered by the convert-to-hex functions (I may fix this in a future commit).
Diffstat (limited to 'src/makefile.unix')
-rw-r--r--src/makefile.unix13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/makefile.unix b/src/makefile.unix
index dad100db10..3c6be3ee41 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -83,7 +83,8 @@ LIBS+= \
DEBUGFLAGS=-g
CXXFLAGS=-O2
-xCXXFLAGS=-pthread -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
+xCXXFLAGS=-pthread -Wextra -Wno-sign-compare -Wno-char-subscripts -Wno-invalid-offsetof -Wformat-security \
+ $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
OBJS= \
obj/checkpoints.o \
@@ -107,17 +108,17 @@ OBJS= \
all: bitcoind
# auto-generated dependencies:
--include obj/nogui/*.P
+-include obj/*.P
-include obj/test/*.P
-obj/nogui/%.o: %.cpp
+obj/%.o: %.cpp
$(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/nogui/%)
+bitcoind: $(OBJS:obj/%=obj/%)
$(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
TESTOBJS := $(patsubst test/%.cpp,obj/test/%.o,$(wildcard test/*.cpp))
@@ -129,14 +130,12 @@ obj/test/%.o: test/%.cpp
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
-test_bitcoin: $(TESTOBJS) $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
+test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
$(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
clean:
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
- -rm -f obj/nogui/*.o
-rm -f obj/test/*.o
-rm -f obj/*.P
- -rm -f obj/nogui/*.P
-rm -f obj/test/*.P