diff --git a/nemu/scripts/build.mk b/nemu/scripts/build.mk index 07c3c79..e6c11bb 100644 --- a/nemu/scripts/build.mk +++ b/nemu/scripts/build.mk @@ -45,11 +45,23 @@ $(OBJ_DIR)/%.tag.c: %.y @mkdir -p $(dir $@) @$(YACC) $(YFLAGS) --header=$(<:.y=.h) -o $@ $< +$(OBJ_DIR)/%.tag.o: $(OBJ_DIR)/%.tag.c + @echo + CC $< + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c -o $@ $< + $(call call_fixdep, $(@:.o=.d), $@) + $(OBJ_DIR)/%.yy.c: %.l $(OBJ_DIR)/%.tag.c @echo + LEX $< @mkdir -p $(dir $@) @$(LEX) $(LFLAGS) -o $@ $< +$(OBJ_DIR)/%.yy.o: %(OBJ_DIR)/%.yy.c + @echo + CC $< + @mkdir -p $(dir $@) + @$(CC) $(CFLAGS) -c -o $@ $< + $(call call_fixdep, $(@:.o=.d), $@) + # Depencies -include $(OBJS:.o=.d)