diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-08-15 16:18:07 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-08-15 16:18:07 +0200 |
commit | c51824f0bc491d1e00645426a36c69151abc85e9 (patch) | |
tree | b7364a7edd837eaeb275e1e380c38082f8c572b5 /scripts | |
parent | 8f36d53f6f2b3a5758a0b6f894d76051cf94403c (diff) | |
download | history-c51824f0bc491d1e00645426a36c69151abc85e9.tar.gz |
kbuild: Generate *.lds instead of *.lds.s
When building a kernel on platforms where the filesytem do
not distingush between upper and lower case the rule:
.S -> .s did not work.
In a normal build this is only used for linker scripts.
So create a separate rule for .lds files, and use generic cpp flags.
Patch from: Dan Aloni <da-x@colinux.org>
Modified to use cpp flags + added documentation.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 8 | ||||
-rw-r--r-- | scripts/Makefile.lib | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 707ad9d0353a52..9312926161fe70 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -219,6 +219,14 @@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< targets += $(real-objs-y) $(real-objs-m) $(lib-y) targets += $(extra-y) $(MAKECMDGOALS) $(always) +# Linker scripts preprocessor (.lds.S -> .lds) +# --------------------------------------------------------------------------- +quiet_cmd_cpp_lds_S = LDS $@ + cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< + +%.lds: %.lds.S FORCE + $(call if_changed_dep,cpp_lds_S) + # Build the compiled-in targets # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0388023241fe1d..3a7663b901f067 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -100,6 +100,7 @@ modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $ _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) +_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) # If building the kernel in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). @@ -107,6 +108,7 @@ _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) ifeq ($(KBUILD_SRC),) __c_flags = $(_c_flags) __a_flags = $(_a_flags) +__cpp_flags = $(_cpp_flags) else # Prefix -I with $(srctree) if it is not an absolute path @@ -120,6 +122,7 @@ flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) # FIXME: Replace both with specific CFLAGS* statements in the makefiles __c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) __a_flags = $(call flags,_a_flags) +__cpp_flags = $(call flags,_cpp_flags) endif c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ @@ -129,6 +132,8 @@ c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(__a_flags) $(modkern_aflags) +cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) + ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) # Finds the multi-part object the current object will be linked into |