summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-30 18:15:06 +0000
committerru <ru@FreeBSD.org>2005-11-30 18:15:06 +0000
commit4491bdb2a5fb708ebb07508e13f3519f08841dcd (patch)
tree432ee1d54c6ccf17d086c6e510c7d5eeb71a3bb5 /sys/conf
parent34db19b97357d7024ca189bd6d251466d6858e0c (diff)
downloadFreeBSD-src-4491bdb2a5fb708ebb07508e13f3519f08841dcd.zip
FreeBSD-src-4491bdb2a5fb708ebb07508e13f3519f08841dcd.tar.gz
Teach this to create the "machine" and ${MACHINE_ARCH} (for pc98
only now) symbolic links in the kernel compile directory, rather than relying on config(8) to do this. (The changes to config(8) will be committed separately.) This is aimed towards making the config(8) as lightweight as possible. Idea by: bde (all bugs are mine)
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/kern.post.mk31
1 files changed, 27 insertions, 4 deletions
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index 4b29211..02f8844 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -112,7 +112,7 @@ kernel-clean:
linterrs makelinks tags vers.c \
vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \
${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \
- ${CLEAN}
+ ${CLEAN} ${_ILINKS}
lint: ${LNFILES}
${LINT} ${LINTKERNFLAGS} ${CFLAGS:M-[DILU]*} ${.ALLSRC} 2>&1 | \
@@ -141,9 +141,10 @@ ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
kernel-depend: .depend
# The argument list can be very long, so use make -V and xargs to
# pass it to mkdep.
-.depend: assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
- ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \
- ${MFILES:T:S/.m$/.h/}
+SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
+ ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \
+ ${MFILES:T:S/.m$/.h/}
+.depend: ${SRCS}
rm -f .newdep
${MAKE} -V CFILES -V SYSTEM_CFILES -V GEN_CFILES | \
MKDEP_CPP="${CC} -E" CC="${CC}" xargs mkdep -a -f .newdep ${CFLAGS}
@@ -152,6 +153,28 @@ kernel-depend: .depend
rm -f .depend
mv .newdep .depend
+_ILINKS= machine
+.if ${MACHINE} != ${MACHINE_ARCH}
+_ILINKS+= ${MACHINE_ARCH}
+.endif
+
+# Ensure that the link exists without depending on it when it exists.
+.for _link in ${_ILINKS}
+.if !exists(${.OBJDIR}/${_link})
+${SRCS}: ${_link}
+.endif
+.endfor
+
+${_ILINKS}:
+ @case ${.TARGET} in \
+ machine) \
+ path=${S}/${MACHINE}/include ;; \
+ ${MACHINE_ARCH}) \
+ path=${S}/${MACHINE_ARCH}/include ;; \
+ esac ; \
+ ${ECHO} ${.TARGET} "->" $$path ; \
+ ln -s $$path ${.TARGET}
+
kernel-cleandepend:
rm -f .depend
OpenPOWER on IntegriCloud