ext: Redirect McPAT object files
All object files and McPAT binaries are moved to directory gem5/build/mcpat/ rather than creating them locally.
This commit is contained in:
parent
0be64ffe2f
commit
8499cb2b65
2 changed files with 22 additions and 23 deletions
|
@ -1,28 +1,30 @@
|
||||||
TAR = mcpat
|
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
|
all: opt
|
||||||
|
|
||||||
dbg: $(TAR).mk obj_dbg
|
dbg: $(TAR).mk $(ODIR)/obj_dbg
|
||||||
@$(MAKE) TAG=dbg -C . -f $(TAR).mk
|
@$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk
|
||||||
|
|
||||||
opt: $(TAR).mk obj_opt
|
opt: $(TAR).mk $(ODIR)/obj_opt
|
||||||
@$(MAKE) TAG=opt -C . -f $(TAR).mk
|
@$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk
|
||||||
|
|
||||||
obj_dbg:
|
$(ODIR)/obj_dbg:
|
||||||
mkdir $@
|
mkdir -p $@
|
||||||
|
|
||||||
obj_opt:
|
$(ODIR)/obj_opt:
|
||||||
mkdir $@
|
mkdir -p $@
|
||||||
|
|
||||||
clean: clean_dbg clean_opt
|
clean: clean_dbg clean_opt
|
||||||
|
|
||||||
clean_dbg: obj_dbg
|
clean_dbg: $(ODIR)/obj_dbg
|
||||||
@$(MAKE) TAG=dbg -C . -f $(TAR).mk clean
|
@$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk clean
|
||||||
rm -rf $<
|
rm -rf $<
|
||||||
|
|
||||||
clean_opt: obj_opt
|
clean_opt: $(ODIR)/obj_opt
|
||||||
@$(MAKE) TAG=opt -C . -f $(TAR).mk clean
|
@$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk clean
|
||||||
rm -rf $<
|
rm -rf $<
|
||||||
|
|
||||||
|
|
|
@ -61,21 +61,18 @@ SRCS = \
|
||||||
wire.cc \
|
wire.cc \
|
||||||
xmlParser.cc
|
xmlParser.cc
|
||||||
|
|
||||||
OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS))
|
OBJS = $(patsubst %.cc,$(ODIR)/obj_$(TAG)/%.o,$(SRCS))
|
||||||
|
|
||||||
all: obj_$(TAG)/$(TARGET)
|
all: $(ODIR)/obj_$(TAG)/$(TARGET)
|
||||||
cp -f obj_$(TAG)/$(TARGET) $(TARGET)
|
cp -f $< $(ODIR)/$(TARGET)
|
||||||
|
|
||||||
obj_$(TAG)/$(TARGET) : $(OBJS)
|
$(ODIR)/obj_$(TAG)/$(TARGET) : $(OBJS)
|
||||||
$(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread
|
$(CXX) $^ -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread
|
||||||
|
|
||||||
#obj_$(TAG)/%.o : %.cc
|
$(ODIR)/obj_$(TAG)/%.o : %.cc
|
||||||
# $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $<
|
|
||||||
|
|
||||||
obj_$(TAG)/%.o : %.cc
|
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o $(TARGET)
|
-rm -f *.o $(ODIR)/$(TARGET)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue