?? makefile
字號:
# The PROGRAM variable should be the name of the final executablePROGRAM = TrafficLight.x# List your .cc-files hereSRCS = TrafficLight.cc input_gen.cc monitor.cc TrafficLight_testbench.ccTARGET_ARCH = gccsparcOS5LIBDIR = -L. -L.. -L$(SYSTEMC)/lib-$(TARGET_ARCH)LIBS = -lsystemc -lmLDFLAGS = -gCC = g++OPT = -O3DEBUGFLAG = #-g#OTHER = -Wall#OTHER = -Wno-deprecated -fexceptions -frtti #-lstdc++#-WallOTHER = -Wno-deprecatedCFLAGS = $(DEBUGFLAG) $(OTHER)EXE = $(PROGRAM)# List all directories from where you include .h-filesINCDIR= -I. -I.. -I$(SYSTEMC)/includeOBJS = $(SRCS:.cc=.o)## Variable that points to SystemC installation path## version 2.1SYSTEMC = /home/TDTS30/sw/systemc-2.1.v1.SUFFIXES: .cc .o .x# This will link all the object files (TrafficLight_testbench.o, TrafficLight.o,# monitor.o, input_gen.o) into an executable called TrafficLight.x$(EXE): $(OBJS) $(CC) $(LDFLAGS) $(INCDIR) $(LIBDIR) -o $(EXE) $(OBJS) $(LIBS)## To build the whole project we must compile each .cc file into a .o## file, and then link all .o-files into an executable. The rule above## tells the make tool how to link the object files into an## executable. To create the object files we need additional rules## (one for each .cc-file). For each .cc-file we add two lines in the## make file. The first line consists of a list of one .cc file## (corresponding to the .o-file beeing created) and possibly a list## of .h-files. Whenever any of the files in the list has changed, the## make tool will recompile the object file. The list should be the## .cc-file beeing compiled, and all the .h-files which are included## in that .cc-file.TrafficLight_testbench.o: TrafficLight_testbench.cc TrafficLight.h input_gen.h monitor.h $(CC) -c $(CFLAGS) $(INCDIR) TrafficLight_testbench.cc -o TrafficLight_testbench.oTrafficLight.o: TrafficLight.cc TrafficLight.h $(CC) -c $(CFLAGS) $(INCDIR) TrafficLight.cc -o TrafficLight.oinput_gen.o: input_gen.cc input_gen.h $(CC) -c $(CFLAGS) $(INCDIR) input_gen.cc -o input_gen.omonitor.o: monitor.cc monitor.h $(CC) -c $(CFLAGS) $(INCDIR) monitor.cc -o monitor.oclean: rm -f $(OBJS) $(EXE) *~#Makefile.deps:# $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.deps#include Makefile.deps
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -