From: trevor_hansen Date: Sun, 6 Sep 2009 15:35:43 +0000 (+0000) Subject: * Update the AST/Makefile to automatically build a "depend" file that contains the... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c12bd22b62ae88796f02c8b12518bce37a6d8d24;p=francis%2Fstp.git * Update the AST/Makefile to automatically build a "depend" file that contains the dependencies of all the source files each time the library is built. If the new version works OK, I'll update the other directories too. * Move AST tests into a test sub-directory. * Clean up the make file to remove redundant rules, and to use wildcard rules git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@190 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/AST/Makefile b/src/AST/Makefile index b9bedad..d976865 100644 --- a/src/AST/Makefile +++ b/src/AST/Makefile @@ -1,63 +1,26 @@ include ../../scripts/Makefile.common -#SRCS = AST.cpp ASTKind.cpp ASTUtil.cpp BitBlast.cpp SimpBool.cpp ToCNF.cpp DPLLMgr.cpp ToSAT.cpp Transform.cpp -SRCS = AST.cpp ASTKind.cpp ASTUtil.cpp BitBlast.cpp SimpBool.cpp ToCNF.cpp ToSAT.cpp Transform.cpp AbstractionRefinement.cpp printer/AssortedPrinters.cpp printer/SMTLIBPrinter.cpp printer/dotPrinter.cpp printer/CPrinter.cpp printer/PLPrinter.cpp printer/LispPrinter.cpp +SRCS=$(wildcard *.cpp printer/*.cpp) +SRCS+= ASTKind.cpp OBJS = $(SRCS:.cpp=.o) CFLAGS += -I../sat/mtl -I../sat/core #Make the ast library for use by other modules -libast.a: $(OBJS) +libast.a: $(OBJS) depend -rm -rf $@ - $(AR) rc libast.a $(OBJS) - $(RANLIB) libast.a - -ASTKind.o: ASTKind.kinds - $(CXX) $(CXXFLAGS) -c -o ASTKind.o ASTKind.cpp + $(AR) rc $@ $(OBJS) + $(RANLIB) $@ # ASTKind.h and ASTKind.cpp are automatically generated ASTKind.h ASTKind.cpp: ASTKind.kinds genkinds.pl ./genkinds.pl -# cnftest: cnftest.o ToCNF.o AST.o ASTUtil.o ASTKind.o BitBlast.o AST.h -# $(CC) $(LDFLAGS) ToCNF.o BitBlast.o ASTKind.o ASTUtil.o AST.o cnftest.o -o cnftest - -# bbtest: $(OBJS) -# $(CC) $(LDFLAGS) BitBlast.o ASTKind.o ASTUtil.o AST.o bbtest.o -o bbtest - -# asttest: $(OBJS) -# $(CC) $(LDFLAGS) ASTKind.o ASTUtil.o AST.o asttest.o -lstdc++ -o asttest - +.PHONY: clean clean: rm -rf *.o *~ bbtest asttest cnftest *.a ASTKind.h ASTKind.cpp .#* - rm -rf printer/*.o printer/*~ + rm -rf printer/*.o -depend: - makedepend -Y -- $(CFLAGS) -- $(SRCS) -# DO NOT DELETE +depend: $(SRCS) + $(CXX) -MM $(CXXFLAGS) $(SRCS) > $@ -AST.o: AST.h ../AST/ASTUtil.h ASTKind.h ../sat/core/Solver.h -AST.o: ../sat/core/SolverTypes.h ../sat/mtl/Heap.h -AST.o: ../sat/core/SolverTypes.h -asttest.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -asttest.o: ../sat/core/SolverTypes.h -asttest.o: ../sat/mtl/Heap.h ../sat/core/SolverTypes.h -ASTUtil.o: ASTUtil.h -bbtest.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -bbtest.o: ../sat/core/SolverTypes.h -bbtest.o: ../sat/mtl/Heap.h ../sat/core/SolverTypes.h -BitBlast.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -BitBlast.o: ../sat/core/SolverTypes.h -BitBlast.o: ../sat/mtl/Heap.h ../sat/core/SolverTypes.h -cnftest.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -cnftest.o: ../sat/core/SolverTypes.h -cnftest.o: ../sat/mtl/Heap.h ../sat/core/SolverTypes.h -ToCNF.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -ToCNF.o: ../sat/core/SolverTypes.h ../sat/mtl/Heap.h -ToCNF.o: ../sat/core/SolverTypes.h -ToSAT.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -ToSAT.o: ../sat/core/SolverTypes.h ../sat/mtl/Heap.h -ToSAT.o: ../sat/core/SolverTypes.h -Transform.o : AST.h ../AST/ASTUtil.h ../AST/ASTKind.h -#DPLLMgr.o: AST.h ../AST/ASTUtil.h ../AST/ASTKind.h ../sat/core/Solver.h -#DPLLMgr.o: ../sat/core/SolverTypes.h ../sat/mtl/Heap.h -#DPLLMgr.o: ../sat/core/SolverTypes.h +-include depend diff --git a/src/AST/bbtest.cpp b/src/AST/test/bbtest.cpp similarity index 99% rename from src/AST/bbtest.cpp rename to src/AST/test/bbtest.cpp index 900ddc3..838b3c4 100644 --- a/src/AST/bbtest.cpp +++ b/src/AST/test/bbtest.cpp @@ -1,4 +1,4 @@ -#include "AST.h" +#include "../AST.h" using namespace BEEV; diff --git a/src/AST/cnftest.cpp b/src/AST/test/cnftest.cpp similarity index 98% rename from src/AST/cnftest.cpp rename to src/AST/test/cnftest.cpp index 7db6166..efffde5 100644 --- a/src/AST/cnftest.cpp +++ b/src/AST/test/cnftest.cpp @@ -2,7 +2,7 @@ // Test program for CNF conversion. -#include "AST.h" +#include "../AST.h" using namespace BEEV;