svn commit: r262733 - head/sys/conf

Mark Johnston markj at FreeBSD.org
Tue Mar 4 14:00:50 UTC 2014


Author: markj
Date: Tue Mar  4 14:00:49 2014
New Revision: 262733
URL: http://svnweb.freebsd.org/changeset/base/262733

Log:
  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

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Tue Mar  4 12:33:18 2014	(r262732)
+++ head/sys/conf/kmod.mk	Tue Mar  4 14:00:49 2014	(r262733)
@@ -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}
 


More information about the svn-src-all mailing list