diff options
author | Sam Ravnborg <sam@neptun.(none)> | 2007-10-15 16:17:25 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-15 16:17:25 -0400 |
commit | 06c5040cdb13d27adad118f2fbfae905a1911b37 (patch) | |
tree | e5e62e04ca2d6f834aed9925a13869f730656139 /Makefile | |
parent | 52bcc3308ae3344266f55bf98a22c1ac0201eda7 (diff) |
kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP
The variable CPPFLAGS is a wellknown variable and the usage by
kbuild may result in unexpected behaviour.
This patch replace use of CPPFLAGS with KBUILD_CPPFLAGS all over the
tree and enabling one to use:
make CPPFLAGS=...
to specify additional CPP commandline options.
Patch was tested on following architectures:
alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k, s390
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -318,7 +318,7 @@ LINUXINCLUDE := -Iinclude \ | |||
318 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ | 318 | $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ |
319 | -include include/linux/autoconf.h | 319 | -include include/linux/autoconf.h |
320 | 320 | ||
321 | CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) | 321 | KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) |
322 | 322 | ||
323 | KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | 323 | KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
324 | -fno-strict-aliasing -fno-common \ | 324 | -fno-strict-aliasing -fno-common \ |
@@ -334,7 +334,7 @@ export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC | |||
334 | export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE | 334 | export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE |
335 | export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | 335 | export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS |
336 | 336 | ||
337 | export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 337 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
338 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE | 338 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE |
339 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 339 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
340 | 340 | ||
@@ -523,9 +523,10 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) | |||
523 | # disable pointer signed / unsigned warnings in gcc 4.0 | 523 | # disable pointer signed / unsigned warnings in gcc 4.0 |
524 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | 524 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) |
525 | 525 | ||
526 | # Add user supplied AFLAGS and CFLAGS as the last assignments | 526 | # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments |
527 | KBUILD_AFLAGS += $(AFLAGS) | 527 | KBUILD_CPPFLAGS += $(CPPFLAGS) |
528 | KBUILD_CFLAGS += $(CFLAGS) | 528 | KBUILD_AFLAGS += $(AFLAGS) |
529 | KBUILD_CFLAGS += $(CFLAGS) | ||
529 | 530 | ||
530 | # Use --build-id when available. | 531 | # Use --build-id when available. |
531 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 532 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
@@ -1507,7 +1508,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) | |||
1507 | 1508 | ||
1508 | 1509 | ||
1509 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1510 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ |
1510 | $(NOSTDINC_FLAGS) $(CPPFLAGS) \ | 1511 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ |
1511 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) | 1512 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) |
1512 | 1513 | ||
1513 | quiet_cmd_as_o_S = AS $@ | 1514 | quiet_cmd_as_o_S = AS $@ |