diff options
| author | tgrogers <Tim Rogers> | 2015-06-05 14:19:06 -0700 |
|---|---|---|
| committer | tgrogers <Tim Rogers> | 2015-06-05 14:19:06 -0700 |
| commit | aafc8c5817a5c6bc1eba432c0ef84491aef5d2f8 (patch) | |
| tree | 2f3d881ba8e3cdbc015c6003d15e39d7aed1bd9b | |
| parent | 3ab52d670fbe4fc79eeba1c9a0061dba69fad3b5 (diff) | |
Adding in changes to put generated code files in the build directory instead of the source directory - since this causes issues for parallel buildwq
| -rw-r--r-- | cuobjdump_to_ptxplus/Makefile | 40 | ||||
| -rw-r--r-- | libcuda/Makefile | 15 | ||||
| -rw-r--r-- | src/intersim2/Makefile | 12 |
3 files changed, 40 insertions, 27 deletions
diff --git a/cuobjdump_to_ptxplus/Makefile b/cuobjdump_to_ptxplus/Makefile index 0358970..242a066 100644 --- a/cuobjdump_to_ptxplus/Makefile +++ b/cuobjdump_to_ptxplus/Makefile @@ -27,41 +27,52 @@ $(OUTPUT_DIR)/cuobjdump_to_ptxplus: $(OUTPUT_DIR)/cuobjdumpInst.o $(OUTPUT_DIR)/ ${LD} ${LDFLAGS} -o $@ $(OUTPUT_DIR)/cuobjdumpInst.o $(OUTPUT_DIR)/cuobjdumpInstList.o $(OUTPUT_DIR)/cuobjdump_to_ptxplus.o $(PTX_PARSER_OBJECTS) $(SASS_PARSER_OBJECTS) $(ELF_PARSER_OBJECTS) $(HEADER_PARSER_OBJECTS) -lex.ptx_.c : ../src/cuda-sim/ptx.l - ${LEX} ${LEXFLAGS} ../src/cuda-sim/ptx.l +$(OUTPUT_DIR)/lex.ptx_.c : ../src/cuda-sim/ptx.l + ${LEX} ${LEXFLAGS} -o$(OUTPUT_DIR)/lex.ptx_.c ../src/cuda-sim/ptx.l -ptx.tab.c : ../src/cuda-sim/ptx.y - ${YACC} ${YFLAGS} --name-prefix=ptx_ -v ../src/cuda-sim/ptx.y +$(OUTPUT_DIR)/ptx.tab.c : ../src/cuda-sim/ptx.y + ${YACC} ${YFLAGS} --name-prefix=ptx_ -v ../src/cuda-sim/ptx.y --file-prefix=$(OUTPUT_DIR)/ptx -ptx.tab.h : ptx.tab.c +$(OUTPUT_DIR)/ptx.tab.h :$(OUTPUT_DIR)/ptx.tab.c -$(OUTPUT_DIR)/lex.ptx_.o : lex.ptx_.c ptx.tab.h - ${CXX} ${CXXFLAGS} -c lex.ptx_.c -o $@ +$(OUTPUT_DIR)/lex.ptx_.o : $(OUTPUT_DIR)/lex.ptx_.c $(OUTPUT_DIR)/ptx.tab.h + ${CXX} ${CXXFLAGS} -c $(OUTPUT_DIR)/lex.ptx_.c -o $@ -$(OUTPUT_DIR)/ptx.tab.o : ptx.tab.c ptx_parser.h - ${CXX} ${CXXFLAGS} -c ptx.tab.c -o $@ +$(OUTPUT_DIR)/ptx.tab.o : $(OUTPUT_DIR)/ptx.tab.c ptx_parser.h + ${CXX} ${CXXFLAGS} -c $(OUTPUT_DIR)/ptx.tab.c -o $@ - -%_lexer.cc: %.l %_parser.hh +$(OUTPUT_DIR)/%_lexer.cc: %.l $(OUTPUT_DIR)/%_parser.hh $(LEX) $(LEXFLAGS) -P $*_ -o$@ $< -%_parser.cc: %.y - $(YACC) $(YFLAGS) -p $*_ -o$@ $< +$(OUTPUT_DIR)/%_parser.cc: %.y + $(YACC) $(YFLAGS) -p $*_ -o$@ $< --file-prefix=$(OUTPUT_DIR)/$@ # The ':' is needed otherwise make gets confused and doesn't understand that it knows how to make %Parser.hpp from %Parser.cpp. # : in bash is equivalent to NOP (no operation) -%_parser.hh: %_parser.cc +$(OUTPUT_DIR)/%_parser.hh: $(OUTPUT_DIR)/%_parser.cc + : + +$(OUTPUT_DIR)/%_parser.hh: %_parser.cc : $(OUTPUT_DIR)/%.o: %.cc $(CXX) ${CXXFLAGS} -c -o $@ $< +$(OUTPUT_DIR)/%.o: $(OUTPUT_DIR)/%.cc + $(CXX) ${CXXFLAGS} -c -o $@ $< + $(OUTPUT_DIR)/%.o: %.cpp %.h $(CXX) ${CXXFLAGS} -c -o $@ $< +$(OUTPUT_DIR)/%.o: $(OUTPUT_DIR)/%.cpp $(OUTPUT_DIR)/%.h + $(CXX) ${CXXFLAGS} -c -o $@ $< + $(OUTPUT_DIR)/%.o: %.c %.h ${CXX} ${CCFLAGS} -c -o $@ $< +$(OUTPUT_DIR)/%.o: $(OUTPUT_DIR)/%.c $(OUTPUT_DIR)/%.h + ${CXX} ${CCFLAGS} -c -o $@ $< + SRCS = $(shell ls *.cc) $(OUTPUT_DIR)/Makefile.makedepend: depend @@ -79,4 +90,3 @@ clean: rm -f $(OUTPUT_DIR)/Makefile.makedepend $(OUTPUT_DIR)/Makefile.makedepend.bak include $(OUTPUT_DIR)/Makefile.makedepend - diff --git a/libcuda/Makefile b/libcuda/Makefile index b1a6552..13932e2 100644 --- a/libcuda/Makefile +++ b/libcuda/Makefile @@ -108,20 +108,23 @@ lib$(PROG).a: $(OBJS) ar rcs $(OUTPUT_DIR)/lib$(PROG).a $(OBJS) $(OUTPUT_DIR)/%.o: %.cc - $(CPP) $(CXXFLAGS) -I./ -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ + $(CPP) $(CXXFLAGS) -I./ -I$(OUTPUT_DIR) -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ $(OUTPUT_DIR)/%.o: %.c - $(CC) $(CCFLAGS) -I./ -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ + $(CC) $(CCFLAGS) -I./ -I$(OUTPUT_DIR) -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ -cuobjdump_parser.c: cuobjdump.y - $(YACC) $(YFLAGS) -p cuobjdump_ -o$@ $< +$(OUTPUT_DIR)/%.o: $(OUTPUT_DIR)/%.c + $(CC) $(CCFLAGS) -I./ -I$(OUTPUT_DIR) -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ -cuobjdump_lexer.c: cuobjdump.l cuobjdump_parser.h +$(OUTPUT_DIR)/cuobjdump_parser.c: cuobjdump.y + $(YACC) $(YFLAGS) -p cuobjdump_ -o$@ $< --file-prefix=$(OUTPUT_DIR)/cuobjdump + +$(OUTPUT_DIR)/cuobjdump_lexer.c: cuobjdump.l $(OUTPUT_DIR)/cuobjdump_parser.h $(LEX) $(LEXFLAGS) -P cuobjdump_ -o$@ $< # The next rule means just get parser.c and you will get parser.h with it # in other words, get parser.c and do nothing to get parser.h -%_parser.h: %_parser.c +$(OUTPUT_DIR)/%_parser.h: $(OUTPUT_DIR)/%_parser.c : $(OUTPUT_DIR)/Makefile.makedepend: depend diff --git a/src/intersim2/Makefile b/src/intersim2/Makefile index fd9fba8..ef948d6 100644 --- a/src/intersim2/Makefile +++ b/src/intersim2/Makefile @@ -126,10 +126,10 @@ endif # rules to compile simulator -${LEX_OBJS}: lex.yy.c y.tab.h +${LEX_OBJS}: $(OBJDIR)/lex.yy.c $(OBJDIR)/y.tab.h $(CC) $(CPPFLAGS) -c $< -o $@ -${YACC_OBJS}: y.tab.c y.tab.h +${YACC_OBJS}: $(OBJDIR)/y.tab.c $(OBJDIR)/y.tab.h $(CC) $(CPPFLAGS) -c $< -o $@ ${OBJDIR}/%.o: %.cpp @@ -168,8 +168,8 @@ clean: rm -f y.tab.c y.tab.h lex.yy.c rm -f moc_bgui.cpp -y.tab.c y.tab.h: config.y - $(YACC) -d $< +$(OBJDIR)/y.tab.c $(OBJDIR)/y.tab.h: config.y + $(YACC) -d $< --file-prefix=$(OBJDIR)/y -lex.yy.c: config.l - $(LEX) $< +$(OBJDIR)/lex.yy.c: config.l + $(LEX) -o$@ $< |
