kbuild: enable use of AFLAGS and CFLAGS on commandline
authorSam Ravnborg <sam@neptun.(none)>
Mon, 15 Oct 2007 20:03:58 +0000 (22:03 +0200)
committerSam Ravnborg <sam@neptun.(none)>
Mon, 15 Oct 2007 20:03:58 +0000 (22:03 +0200)
The previous patches was preparation.
With this patch we can now say:
make CFLAGS=-Os vmlinux

And the option specified will be appended to the
options passed to gcc for C files.

For assembler use:
make AFLAGS=-foo vmlinux
for the same functionality.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Makefile

index 8d3f66441861c807d836c576f3d55804baf1fdde..ad0add0fa7d42ca5d4c8391f67fbb77c7a1aeda4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -523,6 +523,10 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
 # disable pointer signed / unsigned warnings in gcc 4.0
 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 
+# Add user supplied AFLAGS and CFLAGS as the last assignments
+KBUILD_AFLAGS += $(AFLAGS)
+KBUILD_CFLAGS += $(CFLAGS)
+
 # Use --build-id when available.
 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
                              $(call ld-option, -Wl$(comma)--build-id,))