]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
* Use svnversion at build time to insert the current global build revision into a...
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Wed, 9 Sep 2009 11:06:19 +0000 (11:06 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Wed, 9 Sep 2009 11:06:19 +0000 (11:06 +0000)
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@208 e59a4935-1847-0410-ae03-e826735625c1

src/main/Globals.cpp
src/main/Makefile

index 6766a9ba86ddb3b0836d5096f6665b71eabfee9d..24f2311b293e52f07f8d586bb9dbaf5e4d18f503 100644 (file)
@@ -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
index 0fc3a14affb5e35158963ebd6035a59d7ccdc441..787828414ad272e79713c3deaac9e4f6e00b184f 100644 (file)
@@ -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 <string> \n namespace BEEV{extern const std::string version=\"" $(shell svnversion ..) "\";}" > versionString.cpp
+
+ALWAYS_RUN:
+
 
 depend: $(SRCS)
        @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@
 
+
+
 -include depend