From: trevor_hansen Date: Wed, 9 Sep 2009 11:06:19 +0000 (+0000) Subject: * Use svnversion at build time to insert the current global build revision into a... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=59b60a5cf6b65c78006bb7418eb70bd31e421f33;p=francis%2Fstp.git * Use svnversion at build time to insert the current global build revision into a version string. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@208 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/main/Globals.cpp b/src/main/Globals.cpp index 6766a9b..24f2311 100644 --- a/src/main/Globals.cpp +++ b/src/main/Globals.cpp @@ -67,9 +67,8 @@ namespace BEEV ASTVec _empty_ASTVec; //Some global vars for the Main function. - const std::string version = "$Id$"; const char * prog = "stp"; int linenum = 1; const char * usage = "Usage: %s [-option] [infile]\n"; - std::string helpstring = "\n\n"; + std::string helpstring = "\n\n"; }; //end of namespace BEEV diff --git a/src/main/Makefile b/src/main/Makefile index 0fc3a14..7878284 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -1,7 +1,8 @@ include ../../scripts/Makefile.common -SRCS=$(wildcard *.cpp) +SRCS=versionString.cpp main.cpp Globals.cpp OBJS = $(SRCS:.cpp=.o) + LIBS = -L../to-sat -ltosat -L../AST -last -L../abstraction-refinement -labstractionrefinement \ -L../sat -lminisat \ -L../simplifier -lsimplifier \ @@ -11,15 +12,24 @@ LIBS = -L../to-sat -ltosat -L../AST -last -L../abstraction-refinement -labstrac #This rebuilds each time, because the target "parser" is not created #Until the dependencies on each of the libraries is included, that's safest. -parser: $(OBJS) depend +parser: $(OBJS) depend $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o stp @mv stp ../../bin/stp .PHONY: clean clean: - rm -rf *.o *~ *.a .#* depend + rm -rf *.o *~ *.a .#* depend versionString.cpp + +#Use svnversion to output the global revision number. This will be updated every time make is called. Because main.cpp depends on this, it will in turn be rebuilt every time. +versionString.cpp: ALWAYS_RUN + @echo "#include \n namespace BEEV{extern const std::string version=\"" $(shell svnversion ..) "\";}" > versionString.cpp + +ALWAYS_RUN: + depend: $(SRCS) @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + + -include depend