xref: /freebsd/sys/conf/kern.post.mk (revision a259b98fa211ed87bfee58c575de4e2de94ee0fa)
1
2# Part of a unified Makefile for building kernels.  This part includes all
3# the definitions that need to be after all the % directives except %RULES
4# and ones that act like they are part of %RULES.
5#
6# Most make variables should not be defined in this file.  Instead, they
7# should be defined in the kern.pre.mk so that port makefiles can
8# override or augment them.
9
10.if defined(DTS) || defined(DTSO) || defined(FDT_DTS_FILE)
11.include "dtb.build.mk"
12
13KERNEL_EXTRA+=	${DTB} ${DTBO}
14CLEAN+=		${DTB} ${DTBO}
15
16kernel-install: _dtbinstall
17.ORDER: beforeinstall _dtbinstall
18.endif
19
20# In case the config had a makeoptions DESTDIR...
21.if defined(DESTDIR)
22MKMODULESENV+=	DESTDIR="${DESTDIR}"
23.endif
24SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;:tA}
25MKMODULESENV+=	KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
26MKMODULESENV+=  MODULE_TIED=yes
27
28.if defined(CONF_CFLAGS)
29MKMODULESENV+=	CONF_CFLAGS="${CONF_CFLAGS}"
30.endif
31
32.if defined(WITH_CTF)
33MKMODULESENV+=	WITH_CTF="${WITH_CTF}"
34.endif
35
36.if !empty(KCSAN_ENABLED)
37MKMODULESENV+=	KCSAN_ENABLED="yes"
38.endif
39
40.if defined(GCOV_CFLAGS)
41MKMODULESENV+=	GCOV_CFLAGS="${GCOV_CFLAGS}"
42.endif
43
44.if !empty(COMPAT_FREEBSD32_ENABLED)
45MKMODULESENV+=	COMPAT_FREEBSD32_ENABLED="yes"
46.endif
47
48# Allow overriding the kernel debug directory, so kernel and user debug may be
49# installed in different directories. Setting it to "" restores the historical
50# behavior of installing debug files in the kernel directory.
51KERN_DEBUGDIR?=	${DEBUGDIR}
52
53.MAIN: all
54
55.if !defined(NO_MODULES)
56# Default prefix used for modules installed from ports
57LOCALBASE?=	/usr/local
58
59LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules
60
61# Default to installing all modules installed by ports unless overridden
62# by the user.
63.if !defined(LOCAL_MODULES) && exists(${LOCAL_MODULES_DIR})
64LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR}
65.endif
66.endif
67
68.for target in all clean cleandepend cleandir clobber depend install \
69    ${_obj} reinstall tags
70${target}: kernel-${target}
71.if !defined(NO_MODULES)
72${target}: modules-${target}
73modules-${target}:
74.if !defined(MODULES_WITH_WORLD) && exists($S/modules)
75	cd $S/modules; ${MKMODULESENV} ${MAKE} \
76	    ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
77.endif
78.for module in ${LOCAL_MODULES}
79	@${ECHODIR} "===> ${module} (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})"
80	@cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \
81	    DIRPRFX="${module}/" \
82	    ${target:S/^reinstall$/install/:S/^clobber$/cleandir/}
83.endfor
84.endif
85.endfor
86
87# Handle ports (as defined by the user) that build kernel modules
88.if !defined(NO_MODULES) && defined(PORTS_MODULES)
89#
90# The ports tree needs some environment variables defined to match the new kernel
91#
92# SRC_BASE is how the ports tree refers to the location of the base source files
93.if !defined(SRC_BASE)
94SRC_BASE=	${SYSDIR:H:tA}
95.endif
96# OSVERSION is used by some ports to determine build options
97.if !defined(OSRELDATE)
98# Definition copied from src/Makefile.inc1
99OSRELDATE!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
100		    ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h
101.endif
102# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build
103#
104# Ports search for some dependencies in PATH, so add the location of the
105# installed files
106WRKDIRPREFIX?=	${.OBJDIR}
107PORTSMODULESENV=\
108	env \
109	-u CC \
110	-u CXX \
111	-u CPP \
112	-u MAKESYSPATH \
113	-u MK_AUTO_OBJ \
114	-u MAKEOBJDIR \
115	MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*:NMK_AUTO_OBJ=*}" \
116	SYSDIR=${SYSDIR} \
117	PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
118	SRC_BASE=${SRC_BASE} \
119	OSVERSION=${OSRELDATE} \
120	WRKDIRPREFIX=${WRKDIRPREFIX}
121
122# The WRKDIR needs to be cleaned before building, and trying to change the target
123# with a :C pattern below results in install -> instclean
124all:
125.for __i in ${PORTS_MODULES}
126	@${ECHO} "===> Ports module ${__i} (all)"
127	port=${__i}; flavor=$${port#*@}; port=$${port%@*}; flavor=$${flavor%$${port}}; \
128	cd ${PORTSDIR:U/usr/ports}/$${port}; \
129	${PORTSMODULESENV} ${MAKE} -B $${flavor:+FLAVOR=}$${flavor} \
130	    clean build
131.endfor
132
133.for __target in install reinstall clean
134${__target}: ports-${__target}
135ports-${__target}:
136.for __i in ${PORTS_MODULES}
137	@${ECHO} "===> Ports module ${__i} (${__target})"
138	port=${__i}; flavor=$${port#*@}; port=$${port%@*}; flavor=$${flavor%$${port}}; \
139	cd ${PORTSDIR:U/usr/ports}/$${port}; \
140	${PORTSMODULESENV} ${MAKE} -B $${flavor:+FLAVOR=}$${flavor} \
141	    ${__target:C/(re)?install/deinstall reinstall/}
142.endfor
143.endfor
144.endif
145
146# Generate the .bin (booti images) kernel as an extra build output.
147# The targets and rules to generate these appear in Makefile.$MACHINE
148# if the platform supports it.
149.if ${MK_KERNEL_BIN} != "no"
150KERNEL_EXTRA+= ${KERNEL_KO}.bin
151KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
152CLEAN+=	${KERNEL_KO}.bin
153.endif
154
155.ORDER: kernel-install modules-install
156
157beforebuild: .PHONY
158kernel-all: beforebuild .WAIT ${KERNEL_KO} ${KERNEL_EXTRA}
159
160kernel-cleandir: kernel-clean kernel-cleandepend
161
162kernel-clobber:
163	find . -maxdepth 1 ! -type d ! -name version -delete
164
165kernel-obj:
166
167.if !defined(NO_MODULES)
168modules: modules-all
169modules-depend: beforebuild
170modules-all: beforebuild
171
172.if !defined(NO_MODULES_OBJ)
173modules-all modules-depend: modules-obj
174.endif
175.endif
176
177.if !defined(DEBUG)
178FULLKERNEL=	${KERNEL_KO}
179.else
180FULLKERNEL=	${KERNEL_KO}.full
181${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.debug
182	${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.debug \
183	    ${FULLKERNEL} ${.TARGET}
184${KERNEL_KO}.debug: ${FULLKERNEL}
185	${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET}
186install.debug reinstall.debug: gdbinit
187	cd ${.CURDIR}; ${MAKE} ${.TARGET:R}
188
189# Install gdbinit files for kernel debugging.
190gdbinit:
191	grep -v '# XXX' ${S}/../tools/debugscripts/dot.gdbinit | \
192	    sed "s:MODPATH:${.OBJDIR}/modules:" > .gdbinit
193	cp ${S}/../tools/debugscripts/gdbinit.kernel ${.CURDIR}
194.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH})
195	cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH} \
196	    ${.CURDIR}/gdbinit.machine
197.endif
198.endif
199
200${FULLKERNEL}: ${SYSTEM_DEP} vers.o
201	@rm -f ${.TARGET}
202	@echo linking ${.TARGET}
203	${SYSTEM_LD}
204.if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE)
205	@sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE}
206.endif
207.if ${MK_CTF} != "no"
208	@echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ...
209	@${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
210.endif
211.if !defined(DEBUG)
212	${OBJCOPY} --strip-debug ${.TARGET}
213.endif
214	${SYSTEM_LD_TAIL}
215
216OBJS_DEPEND_GUESS+=	offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \
217			${MFILES:T:S/.m$/.h/}
218
219.for mfile in ${MFILES}
220# XXX the low quality .m.o rules gnerated by config are normally used
221# instead of the .m.c rules here.
222${mfile:T:S/.m$/.c/}: ${mfile}
223	${AWK} -f $S/tools/makeobjops.awk ${mfile} -c
224${mfile:T:S/.m$/.h/}: ${mfile}
225	${AWK} -f $S/tools/makeobjops.awk ${mfile} -h
226.endfor
227
228kernel-clean:
229	rm -f *.o *.so *.pico *.ko *.s eddep errs \
230	    ${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.debug \
231	    tags vers.c \
232	    vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \
233	    ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \
234	    ${CLEAN}
235
236# This is a hack.  BFD "optimizes" away dynamic mode if there are no
237# dynamic references.  We could probably do a '-Bforcedynamic' mode like
238# in the a.out ld.  For now, this works.
239force-dynamic-hack.c:
240	:> ${.TARGET}
241
242force-dynamic-hack.pico: force-dynamic-hack.c Makefile
243	${CC} ${CCLDFLAGS} -shared ${CFLAGS} -nostdlib \
244	    force-dynamic-hack.c -o ${.TARGET}
245
246offset.inc: $S/kern/genoffset.sh genoffset.o
247	NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET}
248
249genoffset.o: $S/kern/genoffset.c
250	${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \
251	    -fcommon $S/kern/genoffset.c
252
253# genoffset_test.o is not actually used for anything - the point of compiling it
254# is to exercise the CTASSERT that checks that the offsets in the offset.inc
255# _lite struct(s) match those in the original(s).
256genoffset_test.o: $S/kern/genoffset.c offset.inc
257	${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \
258	    -fcommon -DOFFSET_TEST $S/kern/genoffset.c -o ${.TARGET}
259
260assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o
261	NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET}
262
263# vnode_if.h added for the sake of i386 only to fix commit 72ab129799a2 ("x86:
264# remove sys/mount.h from genassym.c"). Can be removed as soon as i386 kernels
265# are dropped, or if the <sys/mount.h> -> <sys/vnode.h> dependency vanishes.
266genassym.o: $S/$M/$M/genassym.c offset.inc vnode_if.h
267	${CC} -c ${NOSAN_CFLAGS:N-flto*:N-fno-common} \
268	    -fcommon $S/$M/$M/genassym.c
269
270OBJS_DEPEND_GUESS+= opt_global.h
271genoffset.o genassym.o vers.o: opt_global.h
272
273.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon)
274_meta_filemon=	1
275.endif
276.if ${MK_DIRDEPS_BUILD} == "no"
277# Skip reading .depend when not needed to speed up tree-walks and simple
278# lookups.  For install, only do this if no other targets are specified.
279# Also skip generating or including .depend.* files if in meta+filemon mode
280# since it will track dependencies itself.  OBJS_DEPEND_GUESS is still used
281# for _meta_filemon but not for _SKIP_DEPEND.
282.if !defined(NO_SKIP_DEPEND) && \
283    ((!empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*DEP*)) || \
284    ${.TARGETS:M*obj} == ${.TARGETS} || \
285    ${.TARGETS:M*clean*} == ${.TARGETS} || \
286    ${.TARGETS:M*install*} == ${.TARGETS})
287_SKIP_DEPEND=	1
288.endif
289.if defined(_SKIP_DEPEND) || defined(_meta_filemon)
290.MAKE.DEPENDFILE=	/dev/null
291.endif
292.endif
293
294kernel-depend: .depend
295SRCS=	assym.inc offset.inc vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
296	${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \
297	${MFILES:T:S/.m$/.h/}
298DEPENDOBJS+=	${SYSTEM_OBJS} genassym.o genoffset.o genoffset_test.o
299DEPENDOBJS+=	${CLEAN:M*.o}
300DEPENDFILES=	${DEPENDOBJS:O:u:C/^/.depend./}
301.if ${MAKE_VERSION} < 20160220
302DEPEND_MP?=	-MP
303.endif
304.if defined(_SKIP_DEPEND)
305# Don't bother reading any .meta files
306${DEPENDOBJS}:	.NOMETA
307.depend:	.NOMETA
308# Unset these to avoid looping/statting on them later.
309.undef DEPENDOBJS
310.undef DEPENDFILES
311.endif	# defined(_SKIP_DEPEND)
312DEPEND_CFLAGS+=	-MD ${DEPEND_MP} -MF.depend.${.TARGET}
313DEPEND_CFLAGS+=	-MT${.TARGET}
314.if !defined(_meta_filemon)
315.if !empty(DEPEND_CFLAGS)
316# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
317# as those are the only ones we will include.
318DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:M${.TARGET}}" != ""
319CFLAGS+=	${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
320.endif
321.for __depend_obj in ${DEPENDFILES}
322.if ${MAKE_VERSION} < 20160220
323.sinclude "${.OBJDIR}/${__depend_obj}"
324.else
325.dinclude "${.OBJDIR}/${__depend_obj}"
326.endif
327.endfor
328.endif	# !defined(_meta_filemon)
329
330# Always run 'make depend' to generate dependencies early and to avoid the
331# need for manually running it.  For the kernel this is mostly a NOP since
332# all dependencies are correctly added or accounted for.  This is mostly to
333# ensure downstream uses of kernel-depend are handled.
334beforebuild: kernel-depend
335
336# Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet.
337# For meta+filemon the .meta file is checked for since it is the dependency
338# file used.
339.for __obj in ${DEPENDOBJS:O:u}
340.if defined(_meta_filemon)
341_depfile=	${.OBJDIR}/${__obj}.meta
342.else
343_depfile=	${.OBJDIR}/.depend.${__obj}
344.endif
345.if !exists(${_depfile})
346.if ${SYSTEM_OBJS:M${__obj}}
347${__obj}: ${OBJS_DEPEND_GUESS}
348.endif
349${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
350.elif defined(_meta_filemon)
351# For meta mode we still need to know which file to depend on to avoid
352# ambiguous suffix transformation rules from .PATH.  Meta mode does not
353# use .depend files.  We really only need source files, not headers since
354# they are typically in SRCS/beforebuild already.  For target-specific
355# guesses do include headers though since they may not be in SRCS.
356.if ${SYSTEM_OBJS:M${__obj}}
357${__obj}: ${OBJS_DEPEND_GUESS:N*.h}
358.endif
359${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
360.endif	# !exists(${_depfile})
361.endfor
362
363.NOPATH: .depend ${DEPENDFILES}
364
365.depend: .PRECIOUS ${SRCS}
366
367_ILINKS= machine
368.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
369_ILINKS+= ${MACHINE_CPUARCH}
370.endif
371.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
372_ILINKS+= x86
373.endif
374.if ${MACHINE_CPUARCH} == "amd64"
375_ILINKS+= i386
376.endif
377
378.if ${MK_REPRODUCIBLE_PATHS} != "no"
379PREFIX_SYSDIR=/usr/src/sys
380PREFIX_OBJDIR=/usr/obj/usr/src/${MACHINE}.${MACHINE_CPUARCH}/sys/${KERN_IDENT}
381CFLAGS+= -ffile-prefix-map=${SYSDIR}=${PREFIX_SYSDIR}
382CFLAGS+= -ffile-prefix-map=${.OBJDIR}=${PREFIX_OBJDIR}
383.if defined(SYSROOT)
384CFLAGS+= -ffile-prefix-map=${SYSROOT}=/sysroot
385.endif
386.else
387PREFIX_SYSDIR=${SYSDIR}
388PREFIX_OBJDIR=${.OBJDIR}
389.endif
390
391# Ensure that the link exists without depending on it when it exists.
392# Ensure that debug info references the path in the source tree.
393.for _link in ${_ILINKS}
394.if !exists(${.OBJDIR}/${_link})
395${SRCS} ${DEPENDOBJS}: ${_link}
396.endif
397.if ${_link} == "machine"
398CFLAGS+= -fdebug-prefix-map=./machine=${PREFIX_SYSDIR}/${MACHINE}/include
399.else
400CFLAGS+= -fdebug-prefix-map=./${_link}=${PREFIX_SYSDIR}/${_link}/include
401.endif
402.endfor
403
404# Install GDB plugins that are useful for kernel debugging.  See the
405# README in sys/tools/gdb for more information.
406GDB_FILES= acttrace.py \
407	   freebsd.py \
408	   pcpu.py \
409	   selftest.py \
410	   vnet.py
411
412${_ILINKS}:
413	@case ${.TARGET} in \
414	machine) \
415		path=${S}/${MACHINE}/include ;; \
416	*) \
417		path=${S}/${.TARGET}/include ;; \
418	esac ; \
419	${ECHO} ${.TARGET} "->" $$path ; \
420	ln -fns $$path ${.TARGET}
421
422# .depend needs include links so we remove them only together.
423kernel-cleandepend: .PHONY
424	rm -f .depend .depend.* ${_ILINKS}
425
426kernel-tags:
427	@ls .depend.* > /dev/null 2>&1 || \
428	    { echo "you must make all first"; exit 1; }
429	sh $S/conf/systags.sh
430
431kernel-install: .PHONY
432	@if [ ! -f ${KERNEL_KO} ] ; then \
433		echo "You must build a kernel first." ; \
434		exit 1 ; \
435	fi
436.if exists(${DESTDIR}${KODIR})
437	-thiskernel=`sysctl -n kern.bootfile || echo /boot/kernel/kernel` ; \
438	if [ ! "`dirname "$$thiskernel"`" -ef ${DESTDIR}${KODIR} ] ; then \
439		chflags -R noschg ${DESTDIR}${KODIR} ; \
440		rm -rf ${DESTDIR}${KODIR} ; \
441		rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ; \
442	else \
443		if [ -d ${DESTDIR}${KODIR}.old ] ; then \
444			chflags -R noschg ${DESTDIR}${KODIR}.old ; \
445			rm -rf ${DESTDIR}${KODIR}.old ; \
446		fi ; \
447		mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \
448		if [ -n "${KERN_DEBUGDIR}" -a \
449		     -d ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ]; then \
450			rm -rf ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \
451			mv ${DESTDIR}${KERN_DEBUGDIR}${KODIR} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}.old ; \
452		fi ; \
453		sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \
454	fi
455.endif
456	mkdir -p ${DESTDIR}${KODIR}
457	${INSTALL} -p -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR}/
458.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no"
459	mkdir -p ${DESTDIR}${KERN_DEBUGDIR}${KODIR}
460	${INSTALL} -p -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/
461	${INSTALL} -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} \
462	    $S/tools/kernel-gdb.py ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/${KERNEL_KO}-gdb.py
463	${INSTALL} -d -o ${KMODOWN} -g ${KMODGRP} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/gdb
464.for file in ${GDB_FILES}
465	${INSTALL} -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} \
466	    $S/tools/gdb/${file} ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/gdb/${file}
467.endfor
468.endif
469.if defined(KERNEL_EXTRA_INSTALL)
470	${INSTALL} -p -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR}/
471.endif
472
473
474
475kernel-reinstall:
476	@-chflags -R noschg ${DESTDIR}${KODIR}
477	${INSTALL} -p -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR}/
478.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no"
479	${INSTALL} -p -m ${KMODMODE} -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.debug ${DESTDIR}${KERN_DEBUGDIR}${KODIR}/
480.endif
481
482config.o env.o hints.o vers.o vnode_if.o:
483	${NORMAL_C}
484	${NORMAL_CTFCONVERT}
485
486NEWVERS_ENV+= MAKE="${MAKE}"
487.if ${MK_REPRODUCIBLE_BUILD} != "no"
488NEWVERS_ARGS+= -R -d ${PREFIX_OBJDIR}
489.endif
490vers.c: .NOMETA_CMP $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP:Nvers.*}
491	${NEWVERS_ENV} sh $S/conf/newvers.sh ${NEWVERS_ARGS} ${KERN_IDENT}
492
493vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
494	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c
495
496vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: $S/tools/vnode_if.awk \
497    $S/kern/vnode_if.src
498vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h
499	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -h
500vnode_if_newproto.h:
501	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -p
502vnode_if_typedef.h:
503	${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -q
504
505.if ${MFS_IMAGE:Uno} != "no"
506.if empty(MD_ROOT_SIZE_CONFIGURED)
507embedfs_${MFS_IMAGE:T:R}.o: ${MFS_IMAGE} $S/dev/md/embedfs.S
508	${CC} ${CFLAGS} ${ACFLAGS} -DMFS_IMAGE=\""${MFS_IMAGE}"\" -c \
509	    $S/dev/md/embedfs.S -o ${.TARGET}
510.endif
511.endif
512
513.include "kern.mk"
514