summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-03-04 14:00:49 +0000
committermarkj <markj@FreeBSD.org>2014-03-04 14:00:49 +0000
commit4e7fa16cf6bce97b90ffd146c4f62bad5450c1f2 (patch)
treeabd872651a662169de5ac0e21b25184f0c066159 /sys/conf
parent58a9881ebd18f33b5d1a8b7ac7fc90b81e2d5e40 (diff)
downloadFreeBSD-src-4e7fa16cf6bce97b90ffd146c4f62bad5450c1f2.zip
FreeBSD-src-4e7fa16cf6bce97b90ffd146c4f62bad5450c1f2.tar.gz
Use a full path to the target for make rules which create symlinks @,
machine and ${MACHINE_CPUARCH}. Otherwise the presence of a file named "x86" or "x86.c" in the make path can cause problems. Submitted by: lwhsu (original version) MFC after: 1 month
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/kmod.mk17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index bd05878..0d688ef 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -238,7 +238,7 @@ beforedepend: ${_ILINKS}
# causes all the modules to be rebuilt when the directory pointed to changes.
.for _link in ${_ILINKS}
.if !exists(${.OBJDIR}/${_link})
-${OBJS}: ${_link}
+${OBJS}: ${.OBJDIR}/${_link}
.endif
.endfor
@@ -252,18 +252,23 @@ SYSDIR= ${_dir}
.error "can't find kernel source tree"
.endif
-${_ILINKS}:
- @case ${.TARGET} in \
+.for _link in ${_ILINKS}
+.PHONY: ${_link}
+${_link}: ${.OBJDIR}/${_link}
+
+${.OBJDIR}/${_link}:
+ @case ${.TARGET:T} in \
machine) \
path=${SYSDIR}/${MACHINE}/include ;; \
@) \
path=${SYSDIR} ;; \
*) \
- path=${SYSDIR}/${.TARGET}/include ;; \
+ path=${SYSDIR}/${.TARGET:T}/include ;; \
esac ; \
path=`(cd $$path && /bin/pwd)` ; \
- ${ECHO} ${.TARGET} "->" $$path ; \
- ln -sf $$path ${.TARGET}
+ ${ECHO} ${.TARGET:T} "->" $$path ; \
+ ln -sf $$path ${.TARGET:T}
+.endfor
CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS}
OpenPOWER on IntegriCloud