include ../env.mk SYSTEM = system.cpp system2.cpp system3.cpp EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x) EXE_SC = $(SYSTEM:.cpp=_systemc.x) EXE = ${EXE_SCASS} ${EXE_SC} LOG = $(SYSTEM:.cpp=.log) OBJECTS = $(EXE:.x=.o) LINKS = $(OBJECTS:.o=.cpp) PREFIX = $(SYSTEM:.cpp=) #DIFF = $(SYSTEM:.cpp=.diff) .SECONDARY: #%.diff : %_module_graph_reference.dot %_module_graph.dot # diff $*_module_graph_reference.dot $*_module_graph.dot # diff $*_signal_graph_reference.dot $*_signal_graph.dot # diff $*_module_order_reference.dot $*_module_order.dot # diff $*_signal_order_reference.dot $*_signal_order.dot #%_signal_graph_reference.dot %_signal_graph.dot \ # %_module_order_reference.dot %_module_order.dot \ # %_signal_order_reference.dot %_signal_order.dot #%_module_graph.dot : %_systemcass.x # $*_systemcass.x --t # mv module_graph.dot $*_module_graph.dot #%_module_order.dot %_signal_graph.dot %_signal_order.dot : %_systemcass.x # $*_systemcass.x --t --p main : $(EXE) #diff : ${DIFF} test : ${EXE} for i in ${PREFIX} ; do \ echo Testing $$i... ; \ (./$${i}_systemcass.x --t) || eval ${failcom}; \ tail -n +3 module_graph.dot | diff $${i}_module_graph_reference.dot - || eval ${failcom}; \ ./$${i}_systemcass.x --p --t || eval ${failcom}; \ tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference.dot - \ || tail -n +3 signal_graph.dot | diff $${i}_signal_graph_reference2.dot - \ || eval ${failcom}; \ tail -n +3 process_order.dot | diff $${i}_process_order_reference.dot - || eval ${failcom}; \ diff signal_order.txt $${i}_signal_order_reference.txt \ || diff signal_order.txt $${i}_signal_order_reference2.txt \ || eval ${failcom}; \ done (./system_systemc.x) || eval ${failcom} (./system2_systemc.x) || eval ${failcom} (./system3_systemc.x) || eval ${failcom} @echo Test OK. %.gif : %.dot dot -Tgif -o $*.gif $*.dot %_systemc.x : %_systemc.o $(SYSTEMC_LIB) $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT) %_systemcass.x : %_systemcass.o $(SYSTEMCASS_LIB) $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT) include Makefile.deps %_systemc.cpp : %.cpp ln -s $*.cpp $*_systemc.cpp %_systemcass.cpp : %.cpp ln -s $*.cpp $*_systemcass.cpp %_systemc.o : %_systemc.cpp $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o %_systemcass.o : %_systemcass.cpp $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o clean : -echo > Makefile.deps -rm -f *.o gmon.out -rm -f *~ -rm -f ${LOG} -rm -f signal_order.txt module_order.dot signal_graph.dot -rm -f module_order.gif signal_graph.gif -rm -f $(EXE) $(OBJECTS) -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null -rm -f core* -rm -rf generated_by_systemcass -rm -rf tracesystem_systemcass.x.vcd tracesystem_systemc.x.vcd