1 | include ../env.mk |
---|
2 | |
---|
3 | SYSTEM = system.cpp system2.cpp system3.cpp system4.cpp |
---|
4 | EXE_SCASS = $(SYSTEM:.cpp=_systemcass.x) |
---|
5 | EXE_SC = $(SYSTEM:.cpp=_systemc.x) |
---|
6 | EXE = ${EXE_SCASS} ${EXE_SC} |
---|
7 | LOG = $(SYSTEM:.cpp=.log) |
---|
8 | OBJECTS = $(EXE:.x=.o) |
---|
9 | LINKS = $(OBJECTS:.o=.cpp) |
---|
10 | |
---|
11 | .SECONDARY: |
---|
12 | |
---|
13 | main : $(EXE) |
---|
14 | |
---|
15 | test : ${EXE_SCASS} ${EXE_SC} |
---|
16 | @for i in ${EXE_SC} ; do \ |
---|
17 | echo Testing $$i... ; \ |
---|
18 | $$i || eval ${failcom} ; \ |
---|
19 | done |
---|
20 | echo Testing system_systemcass.x ; system_systemcass.x || eval ${failcom} ; \ |
---|
21 | echo Testing system2_systemcass.x ;system2_systemcass.x || eval ${failcom} ; \ |
---|
22 | echo Testing system2_systemcass.x --p --d ;system2_systemcass.x --p --d ; \ |
---|
23 | if [ $$? -ne 37 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \ |
---|
24 | echo Bug detection OK ; \ |
---|
25 | echo Testing system3_systemcass.x ;system3_systemcass.x ; \ |
---|
26 | if [ $$? -ne 165 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \ |
---|
27 | echo Bug detection OK ; \ |
---|
28 | echo Testing system4_systemcass.x ;system4_systemcass.x ; \ |
---|
29 | if [ $$? -ne 101 ] ; then echo "Bug not detected" ; eval $${failcom} ; fi ; \ |
---|
30 | echo Bug detection OK ; \ |
---|
31 | |
---|
32 | %.gif : %.dot |
---|
33 | dot -Tgif -o $*.gif $*.dot |
---|
34 | |
---|
35 | %_systemc.x : %_systemc.o $(SYSTEMC_LIB) |
---|
36 | $(CXX) -o $@ $*_systemc.o $(LFLAGS_SYSTEMC) 2>&1 | $(CPPFILT) |
---|
37 | |
---|
38 | %_systemcass.x : %_systemcass.o $(SYSTEMCASS_LIB) |
---|
39 | $(CXX) -o $@ $*_systemcass.o $(LFLAGS_SYSTEMCASS) 2>&1 | $(CPPFILT) |
---|
40 | |
---|
41 | include Makefile.deps |
---|
42 | |
---|
43 | %_systemc.cpp : %.cpp |
---|
44 | ln -s $*.cpp $*_systemc.cpp |
---|
45 | |
---|
46 | %_systemcass.cpp : %.cpp |
---|
47 | ln -s $*.cpp $*_systemcass.cpp |
---|
48 | |
---|
49 | %_systemc.o : %_systemc.cpp |
---|
50 | $(CXX) $(CFLAGS_SYSTEMC) -MM $*_systemc.cpp >> Makefile.deps |
---|
51 | $(CXX) $(CFLAGS_SYSTEMC) -c $*_systemc.cpp -o $*_systemc.o |
---|
52 | |
---|
53 | %_systemcass.o : %_systemcass.cpp |
---|
54 | $(CXX) $(CFLAGS_SYSTEMCASS) -MM $*_systemcass.cpp >> Makefile.deps |
---|
55 | $(CXX) $(CFLAGS_SYSTEMCASS) -c $*_systemcass.cpp -o $*_systemcass.o |
---|
56 | |
---|
57 | clean : |
---|
58 | -echo > Makefile.deps |
---|
59 | -rm -f *.o gmon.out *~ |
---|
60 | -rm -f ${LOG} |
---|
61 | -rm -f signal_order.txt module_order.dot signal_graph.dot |
---|
62 | -rm -f module_order.gif signal_graph.gif |
---|
63 | -rm -f $(EXE) $(OBJECTS) |
---|
64 | -for i in $(LINKS) ; do unlink $$i ; done 2> /dev/null |
---|
65 | -rm -f core* |
---|
66 | -rm -rf generated_by_systemcass |
---|
67 | -rm -rf system_systemcass.x.vcd system_systemc.x.vcd |
---|
68 | |
---|