From: Sam Ravnborg Date: Mon, 15 Oct 2007 20:03:58 +0000 (+0200) Subject: kbuild: enable use of AFLAGS and CFLAGS on commandline X-Git-Tag: v2.6.24-rc1~830^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52bcc3308ae3344266f55bf98a22c1ac0201eda7;p=linux-2.6 kbuild: enable use of AFLAGS and CFLAGS on commandline 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 --- diff --git a/Makefile b/Makefile index 8d3f664418..ad0add0fa7 100644 --- 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,))