From 6588169d516560f68672e2928680b71c647b7806 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 28 Jul 2010 17:33:09 +0200 Subject: kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line It is now possible to assign options to AS, CC and LD on the command line - which is only used when building modules. {A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile in the arch makefiles, thus users had no way to specify additional options to AS, CC, LD when building modules without overriding the original value. Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE that is used by arch specific files and free up {A,C,LD}FLAGS_MODULE so they can be assigned on the command line. All arch Makefiles that used the old variables has been updated. Note: Previously we had a MODFLAGS variable for both AS and CC. But in favour of consistency this was dropped. So in some cases arch Makefile has one assignmnet replaced by two assignmnets. Note2: MODFLAGS was not documented and is dropped without any notice. I do not expect much/any breakage from this. Signed-off-by: Sam Ravnborg Cc: Denys Vlasenko Cc: Haavard Skinnemoen Cc: Mike Frysinger Cc: Tony Luck Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: Benjamin Herrenschmidt Cc: Martin Schwidefsky Cc: Chen Liqin Acked-by: Mike Frysinger [blackfin] Acked-by: Haavard Skinnemoen [avr32] Signed-off-by: Michal Marek --- scripts/Makefile.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/Makefile.build') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 390aae4bb222..5e7c40e16545 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -115,7 +115,10 @@ endif # --------------------------------------------------------------------------- # Default is built-in, unless we know otherwise -modkern_cflags = $(if $(part-of-module), $(CFLAGS_MODULE), $(CFLAGS_KERNEL)) +modkern_cflags = \ + $(if $(part-of-module), \ + $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ + $(CFLAGS_KERNEL)) quiet_modtag := $(empty) $(empty) $(real-objs-m) : part-of-module := y @@ -250,8 +253,8 @@ $(obj)/%.lst: $(src)/%.c FORCE modkern_aflags := $(AFLAGS_KERNEL) -$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) -$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) +$(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) +$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< -- cgit