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