Skip to content

Commit 52bcc33

Browse files
author
Sam Ravnborg
committed
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 <[email protected]>
1 parent 222d394 commit 52bcc33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
523523
# disable pointer signed / unsigned warnings in gcc 4.0
524524
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
525525

526+
# Add user supplied AFLAGS and CFLAGS as the last assignments
527+
KBUILD_AFLAGS += $(AFLAGS)
528+
KBUILD_CFLAGS += $(CFLAGS)
529+
526530
# Use --build-id when available.
527531
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
528532
$(call ld-option, -Wl$(comma)--build-id,))

0 commit comments

Comments
 (0)