summaryrefslogtreecommitdiffstats
path: root/sys/conf/kmod.mk
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-02-01 17:19:54 +0000
committerbde <bde@FreeBSD.org>1998-02-01 17:19:54 +0000
commit64af97a33981aacf28f370a9fb85a83b2da6065d (patch)
tree5f9621e47f64eec5dcd0e0fd4c9b07c0f2ec1207 /sys/conf/kmod.mk
parent21062993ed358fc12271072743300fc65f43946a (diff)
downloadFreeBSD-src-64af97a33981aacf28f370a9fb85a83b2da6065d.zip
FreeBSD-src-64af97a33981aacf28f370a9fb85a83b2da6065d.tar.gz
Restrict the include search path using -nostdinc -I- in $(CFLAGS} as
in kernel Makefiles. Nothing in /usr/include is used (provided relative paths for sys/* and <machine> can be found), so there is no need for the -I/usr/include kludge as in kernel Makefiles.
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r--sys/conf/kmod.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 9cf946e..d48e9c4 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -1,5 +1,5 @@
# From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
-# $Id: bsd.kmod.mk,v 1.41 1997/11/09 15:03:13 wosch Exp $
+# $Id: bsd.kmod.mk,v 1.42 1998/01/26 20:36:38 bde Exp $
#
# The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules.
#
@@ -92,10 +92,19 @@ MODUNLOAD?= /sbin/modunload
CFLAGS+= ${COPTS} -DKERNEL -DACTUALLY_LKM_NOT_KERNEL ${CWARNFLAGS}
-# Add -I paths for system headers. Individual LKM makefiles don't need any
-# -I paths for this. Most of them need .PATH statement(s) for non-headers.
+# Don't use any standard or source-relative include directories.
+# Since -nostdinc will annull any previous -I paths, we repeat all
+# such paths after -nostdinc. It doesn't seem to be possible to
+# add to the front of `make' variable.
+_ICFLAGS:= ${CFLAGS:M-I*}
+CFLAGS+= -nostdinc -I- ${_ICFLAGS}
+
+# Add -I paths for system headers. Individual LKM makefiles don't
+# need any -I paths for this. Similar defaults for .PATH can't be
+# set because there are no standard paths for non-headers.
CFLAGS+= -I${.OBJDIR} -I${.OBJDIR}/@
+# XXX this is now dubious.
.if defined(DESTDIR)
CFLAGS+= -I${DESTDIR}/usr/include
.endif
OpenPOWER on IntegriCloud