X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2FMakefile.build;h=5eac45f91f86852f322af06cd52c214f39925d99;hb=68c048fb23bd8b0831bbd02ec66900b12390cf19;hp=e48e60da304092be6a66ed3f5f071ce1080a4f0b;hpb=7d219aab70e6951ab82c27c202cac05016696723;p=oweals%2Fbusybox.git diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e48e60da3..5eac45f91 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -13,8 +13,13 @@ __build: include scripts/Kbuild.include # The filename Kbuild has precedence over Makefile +# bbox: we also try to include Kbuild file in obj tree first kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) -include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) +include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, \ + $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, \ + $(kbuild-dir)/Makefile \ + ) \ + ) include scripts/Makefile.lib @@ -216,7 +221,7 @@ $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ -cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< +cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< %.s: %.S FORCE $(call if_changed_dep,as_s_S) @@ -250,9 +255,10 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ; ifdef builtin-target quiet_cmd_link_o_target = LD $@ # If the list of objects to link is empty, just create an empty built-in.o +# -nostdlib is added to make "make LD=gcc ..." work (some people use that) cmd_link_o_target = $(if $(strip $(obj-y)),\ - $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ - rm -f $@; $(AR) rcs $@) + $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ + rm -f $@; $(AR) rcs $@) $(builtin-target): $(obj-y) FORCE $(call if_changed,link_o_target) @@ -284,7 +290,7 @@ link_multi_deps = \ $(filter $(addprefix $(obj)/, \ $($(subst $(obj)/,,$(@:.o=-objs))) \ $($(subst $(obj)/,,$(@:.o=-y)))), $^) - + quiet_cmd_link_multi-y = LD $@ cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)