feat: better rtc framework which aims to remove single rtc restrictions.
[lunaix-os.git] / lunaix-os / kernel.mk
index c8447033ed6ac35a4db9a2ddd8d02184895dec69..5d645140271c724e8305e4d27b35f3e1680daca2 100644 (file)
@@ -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,15 +35,18 @@ CFLAGS += -include flags.h
        $(call status_,CC,$<)
        @$(CC) $(CFLAGS) $(kinc_opts) -c $< -o $@
 
-$(kbin): $(ksrc_objs) $(kbin_dir)
-       $(call status_,LD,$@)
-       @$(CC) -T link/linker.ld -o $(kbin) $(ksrc_objs) $(LDFLAGS)
-
 $(kbin_dir)/modksyms: $(kbin)
        $(call status_,GEN,$@)
        @$(PY) scripts/syms_export.py --bits=32 --order=little -o "$@"  "$<" 
 
-all: $(kbin) $(kbin_dir)/modksyms
+.PHONY: __do_relink
+__do_relink: $(ksrc_objs)
+       $(call status_,LD,$@)
+       @$(CC) -T link/linker.ld -o $(kbin) $(ksrc_objs) $(LDFLAGS)
+
+.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