X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f09e806d5032150564df39a2f7b1192c4d84cf15..7c7b5f05d39b7739d990f71256a2267ec67a6913:/lunaix-os/kernel.mk diff --git a/lunaix-os/kernel.mk b/lunaix-os/kernel.mk index 81e8921..5d64514 100644 --- a/lunaix-os/kernel.mk +++ b/lunaix-os/kernel.mk @@ -4,7 +4,6 @@ include toolchain.mkinc define ksrc_dirs kernel hal - debug libs arch/$(ARCH) endef @@ -12,6 +11,7 @@ endef define kinc_dirs includes includes/usr + arch/$(ARCH)/includes endef @@ -20,6 +20,7 @@ kbin := $(BUILD_NAME) ksrc_files := $(foreach f, $(ksrc_dirs), $(shell find $(f) -name "*.[cS]")) ksrc_objs := $(addsuffix .o,$(ksrc_files)) +ksrc_deps := $(addsuffix .d,$(ksrc_files)) kinc_opts := $(addprefix -I,$(kinc_dirs)) @@ -34,11 +35,18 @@ CFLAGS += -include flags.h $(call status_,CC,$<) @$(CC) $(CFLAGS) $(kinc_opts) -c $< -o $@ -$(kbin): $(ksrc_objs) $(kbin_dir) +$(kbin_dir)/modksyms: $(kbin) + $(call status_,GEN,$@) + @$(PY) scripts/syms_export.py --bits=32 --order=little -o "$@" "$<" + +.PHONY: __do_relink +__do_relink: $(ksrc_objs) $(call status_,LD,$@) @$(CC) -T link/linker.ld -o $(kbin) $(ksrc_objs) $(LDFLAGS) -all: $(kbin) +.PHONY: all +all: __do_relink $(kbin_dir)/modksyms clean: - @rm -f $(ksrc_objs) \ No newline at end of file + @rm -f $(ksrc_objs) + @rm -f $(ksrc_deps) \ No newline at end of file