diff src/makefile.unix @ 2198:5fb54c6da76e draft

Build identification strings All client version information is moved to version.cpp, which optionally (-DHAVE_BUILD_INFO) includes build.h. build.h is automatically generated on supporting platforms via contrib/genbuild.sh, using git describe. The git export-subst attribute is used to put the commit id statically in version.cpp inside generated archives, and this value is used if no build.h is present. The gitian descriptors are modified to use git archive instead of a copy, to create the src/ directory in the output. This way, src/src/version.cpp will contain the static commit id. To prevent gitian builds from getting the "-dirty" marker in their git-describe generated identifiers, no touching of files or running sed on the makefile is performed anymore. This does not seem to influence determinism.
author Pieter Wuille <pieter.wuille@gmail.com>
date Sat, 07 Apr 2012 02:06:53 +0200
parents fab353e96776
children 487d534d3d78
line wrap: on
line diff
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -85,6 +85,7 @@
     $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
 
 OBJS= \
+    obj/version.o \
     obj/checkpoints.o \
     obj/netbase.o \
     obj/addrman.o \
@@ -111,6 +112,10 @@
 -include obj/*.P
 -include obj-test/*.P
 
+build.h: FORCE
+	@../share/genbuild.sh build.h
+DEFS += -DHAVE_BUILD_INFO
+
 obj/%.o: %.cpp
 	$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
 	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
@@ -118,7 +123,7 @@
 	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
 	  rm -f $(@:%.o=%.d)
 
-bitcoind: $(OBJS:obj/%=obj/%)
+bitcoind: build.h $(OBJS:obj/%=obj/%)
 	$(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
 
 TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
@@ -139,3 +144,6 @@
 	-rm -f obj-test/*.o
 	-rm -f obj/*.P
 	-rm -f obj-test/*.P
+	-rm -f src/build.h
+
+FORCE: