Re: [PATCH 1/2] #2 (Generation of *.s files from *.S files in kbuild)

From: Sam Ravnborg
Date: Fri Aug 13 2004 - 13:33:12 EST


On Fri, Aug 13, 2004 at 12:24:26PM +0300, Dan Aloni wrote:
> diff -urN linux-2.6.7/scripts/Makefile.build linux-2.6.7-work/scripts/Makefile.build
> --- linux-2.6.7/scripts/Makefile.build 2004-08-13 12:18:52.000000000 +0300
> +++ linux-2.6.7-work/scripts/Makefile.build 2004-08-13 12:19:00.000000000 +0300
> @@ -194,11 +194,11 @@
> $(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 $@ $<
> +quiet_cmd_as_lds_lds_S = CPP $(quiet_modtag) $@
> +cmd_as_lds_lds_S = $(CPP) $(a_flags) -o $@ $<
>
> -%.s: %.S FORCE
> - $(call if_changed_dep,as_s_S)
> +%.lds: %.lds.S FORCE
> + $(call if_changed_dep,as_lds_lds_S)


This is not good.
The .S -> .s is used for assembly.

An additional rule is needed:

Something like:
quiet_cmd_cpp_lds_S = LDS $@
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -o $@ $<

%.lds: %.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)


Adding a new rule it no longer are acceptable to misuse
AFLAGS for this. So you have to add support for a new
set of flags.
Better name them with CPP so they can be used for other
preprocessings tasks later if needed.

So in Makefile.lib you need to add cpp_flags like a_flags
but using CPPFLAGS, EXTRA_CPPFLAGS, and CPPFLAGS_@

Try building a clean kernel after implementing this.

Thanks,

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/