aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKai Germaschewski <kai@germaschewski.name>2003-08-05 02:08:45 -0400
committerKai Germaschewski <kai@germaschewski.name>2003-08-05 02:08:45 -0400
commit5b0f6ac4c2341ff13f05bec1fb236f65959ca183 (patch)
tree512b51109da04963da9d0701e0f9296273a15714 /Makefile
parent21fbda93a9b6a3af8ddd1c55bd930712322bd6d5 (diff)
downloadhistory-5b0f6ac4c2341ff13f05bec1fb236f65959ca183.tar.gz
kbuild: Move generation of vmlinux.lds.s into arch/.../kernel
Currently, vmlinux.lds.s is generated by the top-level Makefile. Unfortunately, this causes the automatic CONFIG dependencies to not work correctly, the reason being that make caches the timestamps of include/config/* so even after split-include updated the timestamps, make still uses the cached stamps to decide whether to rebuild vmlinux.lds.s. The simple fix is to move generation of vmlinux.lds.s into the arch/$(ARCH)/kernel subdirectories, where we build other files for the final link (like head.o) anyway. This also means some special code in the top-level Makefile for preprocessing can go away, since we now just use the standard rules during the recursive phase. This patches fixes up all archs for this change (untested).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 8 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 67dd4c9635579..ae0c7a1d1e50b 100644
--- a/Makefile
+++ b/Makefile
@@ -388,7 +388,7 @@ define rule_vmlinux
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef
-LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
+LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s
# Generate section listing all symbols and add it into vmlinux
# It's a three stage process:
@@ -414,23 +414,23 @@ cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) > $@
.tmp_kallsyms%.S: .tmp_vmlinux%
$(call cmd,kallsyms)
-.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/vmlinux.lds.s FORCE
+.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
+$(call if_changed_rule,vmlinux__)
-.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/vmlinux.lds.s FORCE
+.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
$(call if_changed_rule,vmlinux__)
endif
# Finally the vmlinux rule
-vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/vmlinux.lds.s FORCE
+vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
$(call if_changed_rule,vmlinux)
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
-$(sort $(vmlinux-objs)): $(SUBDIRS) ;
+$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
@@ -453,15 +453,10 @@ endif
endif
$(if $(CONFIG_MODULES),$(Q)mkdir -p $(MODVERDIR))
-# This can be used by arch/$ARCH/Makefile to preprocess
-# their vmlinux.lds.S file
+# Leave this as default for preprocessing vmlinux.lds.S, which is now
+# done in arch/$(ARCH)/kernel/Makefile
-AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH)
-
-arch/$(ARCH)/vmlinux.lds.s: %.s: %.S scripts FORCE
- $(call if_changed_dep,as_s_S)
-
-targets += arch/$(ARCH)/vmlinux.lds.s
+export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH)
# Single targets
# ---------------------------------------------------------------------------
@@ -882,9 +877,6 @@ endif # ifdef include_config
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
-quiet_cmd_as_s_S = CPP $@
-cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
-
quiet_cmd_as_o_S = AS $@
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<