187278cadc
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>
31 lines
663 B
Makefile
31 lines
663 B
Makefile
# $FreeBSD$
|
|
|
|
# Correct path for kernel builds
|
|
# Don't rely on the kernel's .depend file
|
|
.ifdef MAKESRCPATH
|
|
.PATH: ${MAKESRCPATH}
|
|
DEPENDFILE=
|
|
.else
|
|
MAKESRCPATH= ${.CURDIR}
|
|
CLEANFILES= acpi_wakecode.h acpi_wakecode.bin acpi_wakecode.o
|
|
.endif
|
|
.if ${CC:T:Micc} == "icc"
|
|
CFLAGS+= -restrict
|
|
NOSTDINC= -X
|
|
.else
|
|
NOSTDINC= -nostdinc
|
|
.endif
|
|
CFLAGS+= ${NOSTDINC} -I. -I${MAKESRCPATH}/../..
|
|
|
|
all: acpi_wakecode.h
|
|
|
|
acpi_wakecode.o: acpi_wakecode.S assym.s
|
|
|
|
acpi_wakecode.bin: acpi_wakecode.o
|
|
objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin
|
|
|
|
acpi_wakecode.h: acpi_wakecode.bin acpi_wakecode.o
|
|
sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h
|
|
|
|
.include <bsd.prog.mk>
|