提交 7764f677 创建 作者: Austin Clements's avatar Austin Clements

Put syscall generator recipe in a make function

上级 b36f7b96
......@@ -41,6 +41,12 @@ LDFLAGS = -m elf_x86_64
ALL :=
all:
define SYSCALLGEN
@echo " GEN $@"
$(Q)mkdir -p $(@D)
$(Q)python tools/syscalls.py $(1) kernel/*.cc > $@
endef
include net/Makefrag
include lib/Makefrag
include bin/Makefrag
......
......@@ -142,9 +142,7 @@ $(O)/kernel/trapasm.o: $(O)/include/asmdefines.h
$(O)/kernel/uaccess.o: $(O)/include/asmdefines.h
$(O)/kernel/sysvectors.cc: tools/syscalls.py kernel/*.cc
@echo " GEN $@"
$(Q)mkdir -p $(@D)
$(Q)python $^ --kvectors > $@
$(call SYSCALLGEN,--kvectors)
.PRECIOUS: $(O)/kernel/%.o
-include $(O)/kernel/*.d
......
......@@ -6,14 +6,10 @@ ULIB = ulib.o printf.o umalloc.o uthread.o fmt.o stream.o ipc.o \
ULIB := $(addprefix $(O)/lib/, $(ULIB))
$(O)/lib/sysstubs.S: tools/syscalls.py kernel/*.cc
@echo " GEN $@"
$(Q)mkdir -p $(@D)
$(Q)python $^ --ustubs > $@
$(call SYSCALLGEN,--ustubs)
$(O)/include/sysstubs.h: tools/syscalls.py kernel/*.cc
@echo " GEN $@"
$(Q)mkdir -p $(@D)
$(Q)python $^ --udecls > $@
$(call SYSCALLGEN,--udecls)
.PRECIOUS: $(O)/lib/%.o
-include $(O)/lib/*.d
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论