From 2ebc254419c89e41a424cd02514602ee0f4842e9 Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Wed, 9 Sep 2009 04:00:00 +0000 Subject: [PATCH] * Automatically build dependencies during make. This isn't perfect because the dependencies are only rebuilt when the source files change. They don't get rebuilt when the header files change. So changes to the dependencies inside headers wont be identified until the source file changes, triggering the dependencies to be rebuilt. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@206 e59a4935-1847-0410-ae03-e826735625c1 --- src/AST/Makefile | 4 ++-- src/AST/TestAST/asttest.cpp | 2 +- src/abstraction-refinement/Makefile | 15 ++++++++++----- src/bitvec/Makefile | 16 +++++++++++----- src/c_interface/Makefile | 16 ++++++++++------ src/constantbv/Makefile | 14 +++++++++----- src/main/Makefile | 17 ++++++++++++----- src/main/main.cpp | 2 -- src/simplifier/Makefile | 15 +++++++++++---- src/to-sat/Makefile | 15 +++++++++++---- 10 files changed, 77 insertions(+), 39 deletions(-) diff --git a/src/AST/Makefile b/src/AST/Makefile index 186f0cf..579d4db 100644 --- a/src/AST/Makefile +++ b/src/AST/Makefile @@ -17,10 +17,10 @@ ASTKind.h ASTKind.cpp: ASTKind.kinds genkinds.pl .PHONY: clean clean: - rm -rf *.o *~ bbtest asttest cnftest *.a ASTKind.h ASTKind.cpp .#* + rm -rf *.o *~ bbtest asttest cnftest *.a ASTKind.h ASTKind.cpp .#* depend rm -rf printer/*.o depend: $(SRCS) - $(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ -include depend diff --git a/src/AST/TestAST/asttest.cpp b/src/AST/TestAST/asttest.cpp index 1baafe5..1e33ca9 100644 --- a/src/AST/TestAST/asttest.cpp +++ b/src/AST/TestAST/asttest.cpp @@ -1,4 +1,4 @@ -#include "AST.h" +#include "../AST.h" using namespace BEEV; diff --git a/src/abstraction-refinement/Makefile b/src/abstraction-refinement/Makefile index 2ad3473..c1543c1 100644 --- a/src/abstraction-refinement/Makefile +++ b/src/abstraction-refinement/Makefile @@ -1,12 +1,17 @@ include ../../scripts/Makefile.common -SRCS = AbstractionRefinement.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) -CFLAGS += -I../sat/mtl -I../sat/simp -I../sat/core -libabstractionrefinement.a: $(OBJS) - $(AR) rc $@ $^ +libabstractionrefinement.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend + \ No newline at end of file diff --git a/src/bitvec/Makefile b/src/bitvec/Makefile index 1a864f7..c83b8c5 100644 --- a/src/bitvec/Makefile +++ b/src/bitvec/Makefile @@ -1,12 +1,18 @@ include ../../scripts/Makefile.common -SRCS = consteval.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) -CFLAGS += -I../sat/mtl -I../sat/core -I../sat/simp -libconsteval.a: $(OBJS) - $(AR) rc $@ $^ +libconsteval.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend + \ No newline at end of file diff --git a/src/c_interface/Makefile b/src/c_interface/Makefile index 37cf62e..fef9b48 100644 --- a/src/c_interface/Makefile +++ b/src/c_interface/Makefile @@ -1,14 +1,18 @@ include ../../scripts/Makefile.common -SRCS = c_interface.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) -CFLAGS += -I../sat/mtl -I../sat/core -libcinterface.a: $(OBJS) - $(AR) rc $@ $^ +libcinterface.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend -c_interface.o: c_interface.h diff --git a/src/constantbv/Makefile b/src/constantbv/Makefile index 58920ad..7a4fcd6 100644 --- a/src/constantbv/Makefile +++ b/src/constantbv/Makefile @@ -1,13 +1,17 @@ include ../../scripts/Makefile.common -SRCS = constantbv.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) -libconstantbv.a: $(OBJS) - $(AR) rc $@ $^ +libconstantbv.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend -constantbv.o: constantbv.h +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend diff --git a/src/main/Makefile b/src/main/Makefile index af26bcf..0fc3a14 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -1,6 +1,6 @@ include ../../scripts/Makefile.common -SRCS = Globals.cpp main.cpp +SRCS=$(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) LIBS = -L../to-sat -ltosat -L../AST -last -L../abstraction-refinement -labstractionrefinement \ -L../sat -lminisat \ @@ -8,11 +8,18 @@ LIBS = -L../to-sat -ltosat -L../AST -last -L../abstraction-refinement -labstrac -L../bitvec -lconsteval \ -L../constantbv -lconstantbv \ -L../parser -lparser -CFLAGS += -I../sat/mtl -I../sat/core -I../sat/simp -I../sat/unsound -parser: Globals.o main.o - $(CXX) $(CFLAGS) $(LDFLAGS) Globals.o main.o $(LIBS) -o stp +#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 + $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o stp @mv stp ../../bin/stp +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend diff --git a/src/main/main.cpp b/src/main/main.cpp index 86da686..9efb839 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -7,8 +7,6 @@ ********************************************************************/ // -*- c++ -*- #include "../AST/AST.h" -#include "../sat/core/Solver.h" -#include "../sat/core/SolverTypes.h" #include "../AST/printer/AssortedPrinters.h" #ifdef EXT_HASH_MAP diff --git a/src/simplifier/Makefile b/src/simplifier/Makefile index a486b4d..318b0eb 100644 --- a/src/simplifier/Makefile +++ b/src/simplifier/Makefile @@ -1,12 +1,19 @@ include ../../scripts/Makefile.common -SRCS = simplifier.cpp bvsolver.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) CFLAGS += -I../sat/mtl -I../sat/simp -I../sat/core -libsimplifier.a: $(OBJS) - $(AR) rc $@ $^ +libsimplifier.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend + diff --git a/src/to-sat/Makefile b/src/to-sat/Makefile index 803615f..e8de198 100644 --- a/src/to-sat/Makefile +++ b/src/to-sat/Makefile @@ -1,12 +1,19 @@ include ../../scripts/Makefile.common -SRCS = BitBlast.cpp SimpBool.cpp ToCNF.cpp ToSAT.cpp +SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) CFLAGS += -I../sat/mtl -I../sat/simp -I../sat/core -libtosat.a: $(OBJS) - $(AR) rc $@ $^ +libtosat.a: $(OBJS) depend + $(AR) rc $@ $(OBJS) $(RANLIB) $@ +.PHONY: clean clean: - rm -rf *.o *~ *.a .#* + rm -rf *.o *~ *.a .#* depend + +depend: $(SRCS) + @$(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ + +-include depend + \ No newline at end of file -- 2.47.3