diff --git a/nemu/scripts/build.mk b/nemu/scripts/build.mk index 6d8c623..f050197 100644 --- a/nemu/scripts/build.mk +++ b/nemu/scripts/build.mk @@ -10,7 +10,7 @@ endif WORK_DIR = $(shell pwd) BUILD_DIR = $(WORK_DIR)/build -INC_PATH := $(WORK_DIR)/include $(INC_PATH) +INC_PATH := $(WORK_DIR)/include $(BUILD_DIR)/include $(INC_PATH) OBJ_DIR = $(BUILD_DIR)/obj-$(NAME)$(SO) BINARY = $(BUILD_DIR)/$(NAME)$(SO) @@ -42,13 +42,13 @@ $(OBJ_DIR)/%.o: %.cc $(OBJ_DIR)/%.tag.c: %.y @echo + YACC $< - @mkdir -p $(dir $@) - @$(YACC) $(YFLAGS) --header=$(dir %)/$(<:.y=.h) -o $@ $< + @mkdir -p $(dir $@) $(BUILD_DIR)/include + @$(YACC) $(YFLAGS) --header=$(BUILD_DIR)/include/$(notdir $(<:.y=.h)) -o $@ $< $(OBJ_DIR)/%.yy.c: %.l $(OBJ_DIR)/%.tag.c @echo + LEX $< - @mkdir -p $(dir $@) - @$(LEX) $(LFLAGS) --header=$(dir %)/$(<:.l=_lex.h) -o $@ $< + @mkdir -p $(dir $@) $(BUILD_DIR)/include + @$(LEX) $(LFLAGS) --header=$(BUILD_DIR)/include/$(notdir $(<:.l=_lex.h)) -o $@ $< $(OBJ_DIR)/%.tag.o: $(OBJ_DIR)/%.tag.c @echo + CC $< diff --git a/nemu/src/monitor/sdb/filelist.mk b/nemu/src/monitor/sdb/filelist.mk index 440694a..f477a4f 100644 --- a/nemu/src/monitor/sdb/filelist.mk +++ b/nemu/src/monitor/sdb/filelist.mk @@ -1,3 +1,2 @@ SRCS-y += src/monitor/sdb/addrexp.tag.c src/monitor/sdb/addrexp.yy.c -INC_PATH += $(OBJ_DIR)/src/monitor/sdb LFLAGS += -DYY_NO_UNPUT -DYY_NO_INPUT