From: Yasuko Eckert Date: Tue, 3 Jun 2014 20:32:29 +0000 (-0700) Subject: ext: Redirect McPAT object files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8499cb2b6571979fc94b6a52d642c4e0fb40bc58;p=gem5.git ext: Redirect McPAT object files All object files and McPAT binaries are moved to directory gem5/build/mcpat/ rather than creating them locally. --- diff --git a/ext/mcpat/makefile b/ext/mcpat/makefile index 27f213fa5..f5af29e74 100644 --- a/ext/mcpat/makefile +++ b/ext/mcpat/makefile @@ -1,28 +1,30 @@ TAR = mcpat +BUILD_DIR ?= ../../build +ODIR = $(BUILD_DIR)/mcpat -.PHONY: dbg opt depend clean clean_dbg clean_opt +.PHONY: all dbg opt clean clean_dbg clean_opt all: opt -dbg: $(TAR).mk obj_dbg - @$(MAKE) TAG=dbg -C . -f $(TAR).mk +dbg: $(TAR).mk $(ODIR)/obj_dbg + @$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk -opt: $(TAR).mk obj_opt - @$(MAKE) TAG=opt -C . -f $(TAR).mk +opt: $(TAR).mk $(ODIR)/obj_opt + @$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk -obj_dbg: - mkdir $@ +$(ODIR)/obj_dbg: + mkdir -p $@ -obj_opt: - mkdir $@ +$(ODIR)/obj_opt: + mkdir -p $@ clean: clean_dbg clean_opt -clean_dbg: obj_dbg - @$(MAKE) TAG=dbg -C . -f $(TAR).mk clean +clean_dbg: $(ODIR)/obj_dbg + @$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk clean rm -rf $< -clean_opt: obj_opt - @$(MAKE) TAG=opt -C . -f $(TAR).mk clean +clean_opt: $(ODIR)/obj_opt + @$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk clean rm -rf $< diff --git a/ext/mcpat/mcpat.mk b/ext/mcpat/mcpat.mk index 9aacbe0e6..1e27dcde0 100644 --- a/ext/mcpat/mcpat.mk +++ b/ext/mcpat/mcpat.mk @@ -61,21 +61,18 @@ SRCS = \ wire.cc \ xmlParser.cc -OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS)) +OBJS = $(patsubst %.cc,$(ODIR)/obj_$(TAG)/%.o,$(SRCS)) -all: obj_$(TAG)/$(TARGET) - cp -f obj_$(TAG)/$(TARGET) $(TARGET) +all: $(ODIR)/obj_$(TAG)/$(TARGET) + cp -f $< $(ODIR)/$(TARGET) -obj_$(TAG)/$(TARGET) : $(OBJS) - $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread +$(ODIR)/obj_$(TAG)/$(TARGET) : $(OBJS) + $(CXX) $^ -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread -#obj_$(TAG)/%.o : %.cc -# $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< - -obj_$(TAG)/%.o : %.cc +$(ODIR)/obj_$(TAG)/%.o : %.cc $(CXX) $(CXXFLAGS) -c $< -o $@ clean: - -rm -f *.o $(TARGET) + -rm -f *.o $(ODIR)/$(TARGET)