summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-09-24 01:19:08 +0000
committerkmacy <kmacy@FreeBSD.org>2008-09-24 01:19:08 +0000
commitc01b2f07c60be4c69749ddba8fb198994cca96b5 (patch)
treec2cefca565e13236646646e71b61f22be5442714 /sys/modules
parent1a71eb5c5089d6d5a0e78d0635d718b48223f717 (diff)
downloadFreeBSD-src-c01b2f07c60be4c69749ddba8fb198994cca96b5.zip
FreeBSD-src-c01b2f07c60be4c69749ddba8fb198994cca96b5.tar.gz
- Remove default NIC dependency on ulp headers
- make toe module build dependent on kernel support Submitted by: Chelsio Inc. MFC after: 1 week
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/cxgb/Makefile31
1 files changed, 27 insertions, 4 deletions
diff --git a/sys/modules/cxgb/Makefile b/sys/modules/cxgb/Makefile
index ed43eae..7d56988 100644
--- a/sys/modules/cxgb/Makefile
+++ b/sys/modules/cxgb/Makefile
@@ -1,15 +1,38 @@
# $FreeBSD$
SUBDIR= cxgb
-SUBDIR+= toecore
-SUBDIR+= tom
+SUBDIR+= ${_toecore}
+SUBDIR+= ${_tom}
SUBDIR+= ${_iw_cxgb}
SUBDIR+= cxgb_t3fw
-.if ${MACHINE_ARCH} == "i386"
+.if defined(SYSDIR)
+_sysdir = ${SYSDIR}
+.endif
+
+# Based on bsd.kmod.mk but we don't modify SYSDIR in this one.
+.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
+ /sys /usr/src/sys
+.if !defined(_sysdir) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+_sysdir = ${_dir}
+.endif
+.endfor
+.if !defined(_sysdir) || !exists(${_sysdir}/kern/) || \
+ !exists(${_sysdir}/conf/kmod.mk)
+.error "can't find kernel source tree"
+.endif
+
+_toe_header = ${_sysdir}/netinet/toedev.h
+
+.if exists(${_toe_header})
+_toecore = toecore
+_tom = tom
+.endif
+
+.if ${MACHINE_ARCH} == "i386" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_ARCH} == "amd64" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif
OpenPOWER on IntegriCloud