diff options
| author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-01-24 09:51:36 -0600 |
|---|---|---|
| committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-01-24 09:51:36 -0600 |
| commit | caa9e0e04c20ce4f6884066cb2f4d4e33db07178 (patch) | |
| tree | fc2961e5e174b5a725dfc968c7f14715d5591c9c /scripts/Makefile.build | |
| parent | 1336f151165fd8a2da10a5d8e1a633e3b72e3fd7 (diff) | |
kbuild: Always link module (.ko) from associated (.o)
For extracting the versions and finding the unresolved symbols, we
need multi-part modules to be linked together already, so this
patch separates the building of the modules as a .o file from generating
the .ko in the next step.
Diffstat (limited to 'scripts/Makefile.build')
| -rw-r--r-- | scripts/Makefile.build | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 522c40663372..9581629c08bf 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -224,15 +224,7 @@ quiet_cmd_link_multi-y = LD $@ cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) quiet_cmd_link_multi-m = LD [M] $@ -cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.ko=-objs))) $($(subst $(obj)/,,$(@:.ko=-y)))),$^) init/vermagic.o - -quiet_cmd_link_single-m = LD [M] $@ -cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< init/vermagic.o - -# Don't rebuilt vermagic.o unless we actually are in the init/ dir -ifneq ($(obj),init) -init/vermagic.o: ; -endif +cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) # We would rather have a list of rules like # foo.o: $(foo-objs) @@ -241,13 +233,27 @@ endif $(multi-used-y) : %.o: $(multi-objs-y) FORCE $(call if_changed,link_multi-y) -$(multi-used-m:.o=.ko) : %.ko: $(multi-objs-m) init/vermagic.o FORCE +$(multi-used-m) : %.o: $(multi-objs-m) FORCE + $(touch-module) $(call if_changed,link_multi-m) -$(single-used-m:.o=.ko) : %.ko: %.o init/vermagic.o FORCE - $(call if_changed,link_single-m) +targets += $(multi-used-y) $(multi-used-m) + +# +# Rule to link modules ( .o -> .ko ) +# +quiet_cmd_link_module = LD [M] $@ +cmd_link_module = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< init/vermagic.o + +# Don't rebuilt vermagic.o unless we actually are in the init/ dir +ifneq ($(obj),init) +init/vermagic.o: ; +endif + +$(single-used-m:.o=.ko) $(multi-used-m:.o=.ko): %.ko: %.o init/vermagic.o FORCE + $(call if_changed,link_module) -targets += $(multi-used-y) $(multi-used-m:.o=.ko) $(single-used-m:.o=.ko) +targets += $(single-used-m:.o=.ko) $(multi-used-m:.o=.ko) # Compile programs on the host # =========================================================================== |
