From c51824f0bc491d1e00645426a36c69151abc85e9 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 15 Aug 2004 16:18:07 +0200 Subject: 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 Modified to use cpp flags + added documentation. Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 8 ++++++++ scripts/Makefile.lib | 5 +++++ 2 files changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 707ad9d0353a..9312926161fe 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 0388023241fe..3a7663b901f0 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 -- cgit v1.2.3