diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 16 | ||||
| -rw-r--r-- | src/cuda-sim/Makefile | 82 | ||||
| -rw-r--r-- | src/gpgpu-sim/Makefile | 16 | ||||
| -rw-r--r-- | src/gpuwattch/cacti/cacti.mk | 21 | ||||
| -rw-r--r-- | src/gpuwattch/mcpat.mk | 19 | ||||
| -rw-r--r-- | src/intersim/Makefile | 46 |
6 files changed, 101 insertions, 99 deletions
diff --git a/src/Makefile b/src/Makefile index cc31764..6001669 100644 --- a/src/Makefile +++ b/src/Makefile @@ -56,7 +56,7 @@ OPTFLAGS += -g3 -fPIC CPP = g++ $(SNOW) OEXT = o -OUTPUT_DIR=../$(SIM_OBJ_FILES_DIR) +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR) SRCS = $(shell ls *.cc) OBJS = $(SRCS:%.cc=$(OUTPUT_DIR)/%.$(OEXT)) @@ -66,19 +66,19 @@ $(OUTPUT_DIR)/libgpgpusim.a: $(OBJS) gpu_uarch_simlib gpu_uarch_simlib: make -C ./gpgpu-sim -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null - -$(OUTPUT_DIR)/%.$(OEXT): %.cc - $(CPP) $(OPTFLAGS) $(CXXFLAGS) -o $(OUTPUT_DIR)/$*.$(OEXT) -c $*.cc + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null clean: rm -f *.o core *~ *.a Makefile.makedepend Makefile.makedepend.bak +$(OUTPUT_DIR)/%.$(OEXT): %.cc + $(CPP) $(OPTFLAGS) $(CXXFLAGS) -o $(OUTPUT_DIR)/$*.$(OEXT) -c $*.cc + option_parser.$(OEXT): option_parser.h -include Makefile.makedepend +include $(OUTPUT_DIR)/Makefile.makedepend diff --git a/src/cuda-sim/Makefile b/src/cuda-sim/Makefile index 51a9d8e..166e256 100644 --- a/src/cuda-sim/Makefile +++ b/src/cuda-sim/Makefile @@ -40,11 +40,13 @@ endif include ../../version_detection.mk +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/cuda-sim + OPT := -O3 -g3 -Wall -Wno-unused-function -Wno-sign-compare ifeq ($(DEBUG),1) OPT := -g3 -Wall -Wno-unused-function -Wno-sign-compare endif -OPT += -I$(CUDA_INSTALL_PATH)/include +OPT += -I$(CUDA_INSTALL_PATH)/include -I$(OUTPUT_DIR)/ -I. OPT += -fPIC ifeq ($(TRACE),1) @@ -60,8 +62,6 @@ ifeq ($(GNUC_CPP0X),1) endif endif -OUTPUT_DIR=../../$(SIM_OBJ_FILES_DIR)/cuda-sim - OBJS := $(OUTPUT_DIR)/ptx_parser.o $(OUTPUT_DIR)/ptx_loader.o $(OUTPUT_DIR)/cuda_device_printf.o $(OUTPUT_DIR)/instructions.o $(OUTPUT_DIR)/cuda-sim.o $(OUTPUT_DIR)/ptx_ir.o $(OUTPUT_DIR)/ptx_sim.o $(OUTPUT_DIR)/memory.o $(OUTPUT_DIR)/ptx-stats.o $(OUTPUT_DIR)/decuda_pred_table/decuda_pred_table.o $(OUTPUT_DIR)/ptx.tab.o $(OUTPUT_DIR)/lex.ptx_.o $(OUTPUT_DIR)/ptxinfo.tab.o $(OUTPUT_DIR)/lex.ptxinfo_.o @@ -69,53 +69,53 @@ OPT += -DCUDART_VERSION=$(CUDART_VERSION) SRCS = $(shell ls *.cc) -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null libgpgpu_ptx_sim.a: $(OBJS) ar rcs $(OUTPUT_DIR)/libgpgpu_ptx_sim.a $(OUTPUT_DIR)/ptx.tab.o $(OUTPUT_DIR)/lex.ptx_.o $(OUTPUT_DIR)/ptxinfo.tab.o $(OUTPUT_DIR)/lex.ptxinfo_.o $(OBJS) -$(OUTPUT_DIR)/ptx.tab.o: ptx.tab.c - $(CPP) -c $(OPT) -DYYDEBUG ptx.tab.c -o $(OUTPUT_DIR)/ptx.tab.o +$(OUTPUT_DIR)/ptx.tab.o: $(OUTPUT_DIR)/ptx.tab.c + $(CPP) -c $(OPT) -DYYDEBUG $(OUTPUT_DIR)/ptx.tab.c -o $(OUTPUT_DIR)/ptx.tab.o -$(OUTPUT_DIR)/lex.ptx_.o: lex.ptx_.c - $(CPP) -c $(OPT) lex.ptx_.c -o $(OUTPUT_DIR)/lex.ptx_.o +$(OUTPUT_DIR)/lex.ptx_.o: $(OUTPUT_DIR)/lex.ptx_.c + $(CPP) -c $(OPT) $(OUTPUT_DIR)/lex.ptx_.c -o $(OUTPUT_DIR)/lex.ptx_.o -$(OUTPUT_DIR)/ptxinfo.tab.o: ptxinfo.tab.c - $(CPP) -c $(OPT) -DYYDEBUG ptxinfo.tab.c -o $(OUTPUT_DIR)/ptxinfo.tab.o +$(OUTPUT_DIR)/ptxinfo.tab.o: $(OUTPUT_DIR)/ptxinfo.tab.c + $(CPP) -c $(OPT) -DYYDEBUG $(OUTPUT_DIR)/ptxinfo.tab.c -o $(OUTPUT_DIR)/ptxinfo.tab.o -$(OUTPUT_DIR)/lex.ptxinfo_.o: lex.ptxinfo_.c ptxinfo.tab.c - $(CPP) -c $(OPT) lex.ptxinfo_.c -o $(OUTPUT_DIR)/lex.ptxinfo_.o +$(OUTPUT_DIR)/lex.ptxinfo_.o: $(OUTPUT_DIR)/lex.ptxinfo_.c $(OUTPUT_DIR)/ptxinfo.tab.c + $(CPP) -c $(OPT) $(OUTPUT_DIR)/lex.ptxinfo_.c -o $(OUTPUT_DIR)/lex.ptxinfo_.o -ptx.tab.c: ptx.y - bison --name-prefix=ptx_ -v -d ptx.y +$(OUTPUT_DIR)/ptx.tab.c: ptx.y + bison --name-prefix=ptx_ -v -d ptx.y --file-prefix=$(OUTPUT_DIR)/ptx -ptxinfo.tab.c: ptxinfo.y - bison --name-prefix=ptxinfo_ -v -d ptxinfo.y +$(OUTPUT_DIR)/ptxinfo.tab.c: ptxinfo.y + bison --name-prefix=ptxinfo_ -v -d ptxinfo.y --file-prefix=$(OUTPUT_DIR)/ptxinfo -lex.ptx_.c: ptx.l - flex ptx.l +$(OUTPUT_DIR)/lex.ptx_.c: ptx.l + flex --outfile=$(OUTPUT_DIR)/lex.ptx_.c ptx.l -lex.ptxinfo_.c: ptxinfo.l - flex ptxinfo.l +$(OUTPUT_DIR)/lex.ptxinfo_.c: ptxinfo.l + flex --outfile=$(OUTPUT_DIR)/lex.ptxinfo_.c ptxinfo.l clean: rm -f *~ *.o *.gcda *.gcno *.gcov libgpgpu_ptx_sim.a \ ptx.tab.h ptx.tab.c ptx.output lex.ptx_.c \ ptxinfo.tab.h ptxinfo.tab.c ptxinfo.output lex.ptxinfo_.c \ instructions.h ptx_parser_decode.def directed_tests.log - rm -f decuda_pred_table/*.o - rm -f Makefile.makedepend Makefile.makedepend.bak + rm -f $(OUTPUT_DIR)/decuda_pred_table/*.o + rm -f $(OUTPUT_DIR)/Makefile.makedepend $(OUTPUT_DIR)/Makefile.makedepend.bak $(OUTPUT_DIR)/%.o: %.c $(CPP) -c $(OPT) $< -o $(OUTPUT_DIR)/$*.o $(OUTPUT_DIR)/%.o: %.cc $(CPP) -c $(CXX_OPT) $< -o $(OUTPUT_DIR)/$*.o -instructions.h: instructions.cc +$(OUTPUT_DIR)/instructions.h: instructions.cc @touch $*.h @chmod +w $*.h @echo "// DO NOT EDIT THIS FILE! IT IS AUTOMATICALLY GENERATED BY THE MAKEFILE (see target for instructions.h)" > $*.h @@ -125,25 +125,25 @@ instructions.h: instructions.cc @cat $< | grep "_impl(" | sed 's/{.*//' | sed 's/$$/;/' >> $*.h @echo "#endif" >> $*.h @chmod -w $*.h - @echo "created instructions.h" + @echo "created $(OUTPUT_DIR)/instructions.h" -ptx_parser_decode.def: ptx.tab.c +$(OUTPUT_DIR)/ptx_parser_decode.def: $(OUTPUT_DIR)/ptx.tab.c ifeq ($(shell uname),Linux) - cat ptx.tab.h | grep "=" | sed 's/^[ ]\+//' | sed 's/[=,]//g' | sed 's/\([_A-Z1-9]\+\)[ ]\+\([0-9]\+\)/\1 \1/' | sed 's/^/DEF(/' | sed 's/ /,"/' | sed 's/$$/")/' > ptx_parser_decode.def + cat $(OUTPUT_DIR)/ptx.tab.h | grep "=" | sed 's/^[ ]\+//' | sed 's/[=,]//g' | sed 's/\([_A-Z1-9]\+\)[ ]\+\([0-9]\+\)/\1 \1/' | sed 's/^/DEF(/' | sed 's/ /,"/' | sed 's/$$/")/' > $(OUTPUT_DIR)/ptx_parser_decode.def else - cat ptx.tab.h | grep "=" | sed -E 's/^ +//' | sed 's/[=,]//g' | sed -E 's/([_A-Z1-9]+).*/\1 \1/' | sed 's/^/DEF(/' | sed 's/ /,"/' | sed 's/$$/")/' > ptx_parser_decode.def + cat $(OUTPUT_DIR)/ptx.tab.h | grep "=" | sed -E 's/^ +//' | sed 's/[=,]//g' | sed -E 's/([_A-Z1-9]+).*/\1 \1/' | sed 's/^/DEF(/' | sed 's/ /,"/' | sed 's/$$/")/' > $(OUTPUT_DIR)/ptx_parser_decode.def endif -$(OUTPUT_DIR)/instructions.o: instructions.h ptx.tab.c -$(OUTPUT_DIR)/cuda_device_printf.o: ptx.tab.c -$(OUTPUT_DIR)/ptx_ir.o: ptx.tab.c ptx_parser_decode.def -$(OUTPUT_DIR)/ptx_loader.o: ptx.tab.c ptx_parser_decode.def -$(OUTPUT_DIR)/ptx_parser.o: ptx.tab.c ptx_parser_decode.def -$(OUTPUT_DIR)/ptxinfo.tab.o: ptx.tab.c -$(OUTPUT_DIR)/ptx-stats.o: ptx.tab.c -$(OUTPUT_DIR)/ptx_sim.o: ptx.tab.c -$(OUTPUT_DIR)/cuda-sim.o: ptx.tab.c -$(OUTPUT_DIR)/lex.ptxinfo_.o: ptx.tab.c -$(OUTPUT_DIR)/lex.ptx_.o: ptx.tab.c - +$(OUTPUT_DIR)/instructions.o: $(OUTPUT_DIR)/instructions.h $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/cuda_device_printf.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/ptx_ir.o: $(OUTPUT_DIR)/ptx.tab.c $(OUTPUT_DIR)/ptx_parser_decode.def +$(OUTPUT_DIR)/ptx_loader.o: $(OUTPUT_DIR)/ptx.tab.c $(OUTPUT_DIR)/ptx_parser_decode.def +$(OUTPUT_DIR)/ptx_parser.o: $(OUTPUT_DIR)/ptx.tab.c $(OUTPUT_DIR)/ptx_parser_decode.def +$(OUTPUT_DIR)/ptxinfo.tab.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/ptx-stats.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/ptx_sim.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/cuda-sim.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/lex.ptxinfo_.o: $(OUTPUT_DIR)/ptx.tab.c +$(OUTPUT_DIR)/lex.ptx_.o: $(OUTPUT_DIR)/ptx.tab.c +include $(OUTPUT_DIR)/Makefile.makedepend diff --git a/src/gpgpu-sim/Makefile b/src/gpgpu-sim/Makefile index b9749e5..e355b59 100644 --- a/src/gpgpu-sim/Makefile +++ b/src/gpgpu-sim/Makefile @@ -67,7 +67,7 @@ OPTFLAGS += -g3 -fPIC CPP = g++ $(SNOW) OEXT = o -OUTPUT_DIR=../../$(SIM_OBJ_FILES_DIR)/gpgpu-sim +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/gpgpu-sim SRCS = $(shell ls *.cc) @@ -84,11 +84,11 @@ OBJS = $(CSRCS:%.cc=$(OUTPUT_DIR)/%.$(OEXT)) libgpu_uarch_sim.a:$(OBJS) ar rcs $(OUTPUT_DIR)/libgpu_uarch_sim.a $(OBJS) -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -p$(OUTPUT_DIR)/ $(CSRCS) 2> /dev/null + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(CSRCS) 2> /dev/null $(OUTPUT_DIR)/l2cache.$(OEXT): l2cache.cc $(CPP) $(OPTFLAGS) $(CXXFLAGS_L2CACHE) -o $*.$(OEXT) -c l2cache.cc @@ -102,10 +102,10 @@ clean: $(OUTPUT_DIR)/option_parser.$(OEXT): option_parser.h -$(OUTPUT_DIR)/dram_sched.$(OEXT): ../cuda-sim/ptx.tab.h +$(OUTPUT_DIR)/dram_sched.$(OEXT): $(OUTPUT_DIR)/../cuda-sim/ptx.tab.h -../cuda-sim/ptx.tab.h: - make -C ../cuda-sim/ ptx.tab.c +$(OUTPUT_DIR)/../cuda-sim/ptx.tab.h: + make -C ../cuda-sim/ $(OUTPUT_DIR)/../cuda-sim/ptx.tab.c -include Makefile.makedepend +include $(OUTPUT_DIR)/Makefile.makedepend diff --git a/src/gpuwattch/cacti/cacti.mk b/src/gpuwattch/cacti/cacti.mk index c8c2192..1de6e9e 100644 --- a/src/gpuwattch/cacti/cacti.mk +++ b/src/gpuwattch/cacti/cacti.mk @@ -1,3 +1,5 @@ + +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/gpuwattch/cacti TARGET = cacti SHELL = /bin/sh .PHONY: all depend clean @@ -35,30 +37,29 @@ SRCS = area.cc bank.cc mat.cc main.cc Ucache.cc io.cc technology.cc basic_circu decoder.cc component.cc uca.cc subarray.cc wire.cc htree2.cc \ cacti_interface.cc router.cc nuca.cc crossbar.cc arbiter.cc -OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS)) -PYTHONLIB_SRCS = $(patsubst main.cc, ,$(SRCS)) obj_$(TAG)/cacti_wrap.cc +OBJS = $(patsubst %.cc,$(OUTPUT_DIR)/%.o,$(SRCS)) +PYTHONLIB_SRCS = $(patsubst main.cc, ,$(SRCS)) $(OUTPUT_DIR)/cacti_wrap.cc PYTHONLIB_OBJS = $(patsubst %.cc,%.o,$(PYTHONLIB_SRCS)) INCLUDES = -I /usr/include/python2.4 -I /usr/lib/python2.4/config -all: obj_$(TAG)/$(TARGET) - cp -f obj_$(TAG)/$(TARGET) $(TARGET) +all: $(OUTPUT_DIR)/$(TARGET) -obj_$(TAG)/$(TARGET) : $(OBJS) +$(OUTPUT_DIR)/$(TARGET) : $(OBJS) $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread #obj_$(TAG)/%.o : %.cc # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -pobj_$(TAG)/ -a $(SRCS) 2> /dev/null + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ -a $(SRCS) 2> /dev/null -obj_$(TAG)/%.o : %.cc +$(OUTPUT_DIR)/%.o : %.cc $(CXX) $(CXXFLAGS) -c $< -o $@ clean: -rm -f *.o _cacti.so cacti.py $(TARGET) -include Makefile.makedepend +include $(OUTPUT_DIR)/Makefile.makedepend diff --git a/src/gpuwattch/mcpat.mk b/src/gpuwattch/mcpat.mk index 64db479..a09c23b 100644 --- a/src/gpuwattch/mcpat.mk +++ b/src/gpuwattch/mcpat.mk @@ -1,3 +1,5 @@ + +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/gpuwattch TARGET = mcpat SHELL = /bin/sh .PHONY: all depend clean @@ -76,29 +78,28 @@ SRCS = \ -OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS)) +OBJS = $(patsubst %.cc,$(OUTPUT_DIR)/%.o,$(SRCS)) -all: obj_$(TAG)/$(TARGET) - cp -f obj_$(TAG)/$(TARGET) $(TARGET) +all: $(OUTPUT_DIR)/$(TARGET) -obj_$(TAG)/$(TARGET) : $(OBJS) +$(OUTPUT_DIR)/$(TARGET) : $(OBJS) $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread #obj_$(TAG)/%.o : %.cc # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< -obj_$(TAG)/%.o : %.cc +$(OUTPUT_DIR)/%.o : %.cc $(CXX) $(CXXFLAGS) -c $< -o $@ -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -pobj_$(TAG)/ $(SRCS) 2> /dev/null + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null $(MAKE) -C ./cacti/ depend clean: -rm -f *.o $(TARGET) rm -f Makefile.makedepend Makefile.makedepend.bak -include Makefile.makedepend +include $(OUTPUT_DIR)/Makefile.makedepend diff --git a/src/intersim/Makefile b/src/intersim/Makefile index 0613274..cf42bb5 100644 --- a/src/intersim/Makefile +++ b/src/intersim/Makefile @@ -13,16 +13,19 @@ LEX = flex PURIFY = /usr/bin/purify QUANT = /usr/bin/quantify +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/intersim INTERFACE = interconnect_interface.cpp DEBUG = 0 -CPPFLAGS = -g -Wall +CPPFLAGS = -g -Wall ifneq ($(DEBUG),1) CPPFLAGS = -O3 -g else CPPFLAGS += endif +CPPFLAGS += -I$(OUTPUT_DIR) -I. + TEST = -DUNIT_TEST ifneq ($(UNIT_TEST),1) TEST = @@ -32,7 +35,6 @@ endif PROG = intersim -OUTPUT_DIR=../../$(SIM_OBJ_FILES_DIR)/intersim CPP_SRCS = $(INTERFACE) \ config_utils.cpp \ @@ -69,23 +71,18 @@ CPP_SRCS = $(INTERFACE) \ rng_double_wrapper.cpp \ statwraper.cpp -#LEX_OBJS = $(OUTPUT_DIR)/configlex.o -LEX_OBJS = configlex.o -#YACC_OBJS = $(OUTPUT_DIR)/config_tab.o -YACC_OBJS = config_tab.o +LEX_OBJS = $(OUTPUT_DIR)/configlex.o +YACC_OBJS = $(OUTPUT_DIR)/config_tab.o #--- Make rules --- OBJS = $(CPP_SRCS:%.cpp=$(OUTPUT_DIR)/%.o) $(LEX_OBJS) $(YACC_OBJS) .PHONY: clean -.PRECIOUS: %_tab.cpp %_tab.hpp %lex.cpp +.PRECIOUS: $(OUTPUT_DIR)/%_tab.cpp $(OUTPUT_DIR)/%_tab.hpp $(OUTPUT_DIR)/%lex.cpp lib$(PROG).a: $(OBJS) ar rcs $(OUTPUT_DIR)/lib$(PROG).a $(OBJS) - mv $(LEX_OBJS) $(OUTPUT_DIR)/ - mv $(YACC_OBJS) $(OUTPUT_DIR)/ - purify: $(OBJS) $(PURIFY) -always-use-cache-dir $(CPP) $(OBJS) -o $(PROG) -L/usr/lib @@ -93,26 +90,29 @@ purify: $(OBJS) quantify: $(OBJS) $(QUANT) -always-use-cache-dir $(CPP) $(OBJS) -o $(PROG) -L/usr/lib -%lex.o: %lex.cpp %_tab.hpp +$(OUTPUT_DIR)/%lex.o: $(OUTPUT_DIR)/%lex.cpp $(OUTPUT_DIR)/%_tab.hpp $(CPP) $(CPPFLAGS) -c $< -o $@ $(OUTPUT_DIR)/%.o: %.cpp $(CPP) $(EXTRA) $(CPPFLAGS) $(TEST) -c $< -o $@ + +$(OUTPUT_DIR)/%.o: $(OUTPUT_DIR)/%.cpp + $(CPP) $(EXTRA) $(CPPFLAGS) $(TEST) -c $< -o $@ $(OUTPUT_DIR)/%.o: %.c $(CPP) $(CPPFLAGS) $(TEST) $(VCSFLAGS) -c $< -o $@ -%_tab.cpp: %.y - $(YACC) -b$* -p$* $< - cp -f $*.tab.c $*_tab.cpp +$(OUTPUT_DIR)/%_tab.cpp: %.y + $(YACC) -b$* -p$* $< --file-prefix=$(OUTPUT_DIR)/$* + cp -f $(OUTPUT_DIR)/$*.tab.c $(OUTPUT_DIR)/$*_tab.cpp -%_tab.hpp: %_tab.cpp - cp -f $*.tab.h $*_tab.hpp +$(OUTPUT_DIR)/%_tab.hpp: $(OUTPUT_DIR)/%_tab.cpp + cp -f $(OUTPUT_DIR)/$*.tab.h $(OUTPUT_DIR)/$*_tab.hpp -%lex.cpp: %.l - $(LEX) -P$* -o$@ $< - cp configlex.cpp configlex.cpp.orig - awk '/configlineno = 1/ {if (line == 0) {line = 1; print} next;} //{print}' configlex.cpp.orig > configlex.cpp +$(OUTPUT_DIR)/%lex.cpp: %.l + $(LEX) --outfile=$@ -P$* $< + cp $(OUTPUT_DIR)/configlex.cpp $(OUTPUT_DIR)/configlex.cpp.orig + awk '/configlineno = 1/ {if (line == 0) {line = 1; print} next;} //{print}' $(OUTPUT_DIR)/configlex.cpp.orig > $(OUTPUT_DIR)/configlex.cpp clean: rm -f $(OBJS) *_tab.cpp *_tab.hpp *.tab.c *.tab.h *lex.cpp @@ -121,7 +121,7 @@ clean: rm -f lib$(PROG).so rm -f $(OBJS) *.o -interconnect_interface.o: ../cuda-sim/ptx.tab.h +$(OUTPUT_DIR)/interconnect_interface.o: $(OUTPUT_DIR)/../cuda-sim/ptx.tab.h -../cuda-sim/ptx.tab.h: - make -C ../cuda-sim/ ptx.tab.c +$(OUTPUT_DIR)/../cuda-sim/ptx.tab.h: + make -C ../cuda-sim/ $(OUTPUT_DIR)/../cuda-sim/ptx.tab.c |
