summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.pre.mk
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-08-17 20:39:28 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-08-17 20:39:28 +0000
commitf63ab9228e0818135be1431b017306e2062147ae (patch)
treee9956831a046982571c4a2200db030fbab894a73 /sys/conf/kern.pre.mk
parentb449f3828322f9f90a73e893ab857f0773d9832c (diff)
downloadFreeBSD-src-f63ab9228e0818135be1431b017306e2062147ae.zip
FreeBSD-src-f63ab9228e0818135be1431b017306e2062147ae.tar.gz
For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename of the compiler command (excluding any arguments) is considered. This allows you to use, for example, CC="/nondefault/path/clang -xxx", and still have the various tests in bsd.*.mk identify your compiler as clang correctly. ICC if cases were also changed. Submitted by: Dimitry Andric <dimitry at andric.com>
Diffstat (limited to 'sys/conf/kern.pre.mk')
-rw-r--r--sys/conf/kern.pre.mk10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 7642fca..b61113e 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -23,7 +23,7 @@ NM?= nm
OBJCOPY?= objcopy
SIZE?= size
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
COPTFLAGS?= -O
.else
. if defined(DEBUG)
@@ -48,7 +48,7 @@ COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
COPTFLAGS+= ${_CPUCFLAGS}
. endif
.endif
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
C_DIALECT=
NOSTDINC= -X
.else
@@ -92,8 +92,8 @@ INCLUDES+= -I$S/dev/cxgb
CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS}
CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
-.if ${CC} != "icc"
-.if ${CC} != "clang"
+.if ${CC:T:Micc} != "icc"
+.if ${CC:T:Mclang} != "clang"
CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
.if ${MACHINE_CPUARCH} != "mips"
CFLAGS+= --param inline-unit-growth=100
@@ -111,7 +111,7 @@ WERROR?= -Werror
ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
-.if ${CC} == "icc" || ${CC} == "clang"
+.if ${CC:T:Micc} == "icc" || ${CC:T:Mclang} == "clang"
.error "Profiling doesn't work with icc or clang yet"
.endif
CFLAGS+= -DGPROF -falign-functions=16
OpenPOWER on IntegriCloud