1# Makefile for FreeBSD(98) after: 2# 3# Makefile.i386 -- with config changes. 4# Copyright 1990 W. Jolitz 5# from: @(#)Makefile.i386 7.1 5/10/91
| 1# Makefile for FreeBSD(98) after: 2# 3# Makefile.i386 -- with config changes. 4# Copyright 1990 W. Jolitz 5# from: @(#)Makefile.i386 7.1 5/10/91
|
6# $FreeBSD: head/sys/conf/Makefile.pc98 85198 2001-10-19 22:19:06Z mp $
| 6# $FreeBSD: head/sys/conf/Makefile.pc98 85532 2001-10-26 10:33:45Z ru $
|
7# 8# Makefile for FreeBSD 9# 10# This makefile is constructed from a machine description: 11# config machineid 12# Most changes should be made in the machine description
| 7# 8# Makefile for FreeBSD 9# 10# This makefile is constructed from a machine description: 11# config machineid 12# Most changes should be made in the machine description
|
13# /sys/i386/conf/``machineid''
| 13# /sys/pc98/conf/``machineid''
|
14# after which you should do 15# config machineid 16# Generic makefile changes should be made in
| 14# after which you should do 15# config machineid 16# Generic makefile changes should be made in
|
17# /sys/i386/conf/Makefile.i386
| 17# /sys/conf/Makefile.pc98
|
18# after which config should be rerun for all machines. 19# 20 21# Which version of config(8) is required. 22%VERSREQ= 500008 23 24# Can be overridden by makeoptions or /etc/make.conf 25KERNEL_KO?= kernel 26KERNEL?= kernel 27KODIR?= /boot/${KERNEL} 28#STD8X16FONT?= iso 29 30.if !defined(S) 31.if exists(./@/.) 32S= ./@ 33.else 34S= ../../.. 35.endif 36.endif 37M= ${MACHINE_ARCH} 38 39NM?= nm 40OBJCOPY?= objcopy 41SIZE?= size 42 43COPTFLAGS?=-O -pipe 44.if !defined(NO_CPU_COPTFLAGS) 45COPTFLAGS+= ${_CPUCFLAGS} 46.endif 47INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev 48 49# This hack lets us use the Intel ACPICA code without spamming a new 50# include path into 100+ source files. 51INCLUDES+= -I$S/contrib/dev/acpica 52 53# ... and the same for ipfilter 54INCLUDES+= -I$S/contrib/ipfilter 55 56# This hack is to allow kernel compiles to succeed on machines w/out srcdist 57.if exists($S/../include) 58INCLUDES+= -I$S/../include 59.else 60INCLUDES+= -I/usr/include 61.endif 62 63COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h 64CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 65 66# XXX LOCORE means "don't declare C stuff" not "for locore.s". 67ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} 68 69# Select the correct set of tools. Can't set OBJFORMAT here because it 70# doesn't get exported into the environment, and if it were exported 71# then it might break building of utilities. 72FMT= -elf 73CFLAGS+= ${FMT} 74 75DEFINED_PROF= ${PROF} 76.if defined(PROF) 77CFLAGS+= -malign-functions=4 78.if ${PROFLEVEL} >= 2 79IDENT+= -DGPROF4 -DGUPROF 80PROF+= -mprofiler-epilogue 81.endif 82.endif 83 84# Put configuration-specific C flags last (except for ${PROF}) so that they 85# can override the others. 86CFLAGS+= ${CONF_CFLAGS} 87 88NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} 89NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} 90NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${.IMPSRC} 91PROFILE_C= ${CC} -c ${CFLAGS} ${.IMPSRC} 92 93NORMAL_M= perl5 $S/kern/makeobjops.pl -c $<; \ 94 ${CC} -c ${CFLAGS} ${PROF} ${.PREFIX}.c 95 96GEN_CFILES= $S/$M/$M/genassym.c 97SYSTEM_CFILES= vnode_if.c hints.c env.c config.c 98SYSTEM_SFILES= $S/$M/$M/locore.s 99SYSTEM_DEP= Makefile ${SYSTEM_OBJS} 100SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} hints.o env.o config.o hack.So 101SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \ 102 -export-dynamic -dynamic-linker /red/herring \ 103 -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 104SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ 105 ${SIZE} ${FMT} ${.TARGET} ; chmod 755 ${.TARGET} 106SYSTEM_DEP+= $S/conf/ldscript.$M 107 108%BEFORE_DEPEND 109 110%OBJS 111 112%FILES.c 113 114%FILES.s 115 116%FILES.m 117 118%CLEAN 119 120.PHONY: all modules 121 122all: ${KERNEL_KO} 123 124depend: kernel-depend 125clean: kernel-clean 126cleandepend: kernel-cleandepend 127clobber: kernel-clobber 128tags: kernel-tags 129install: kernel-install 130install.debug: kernel-install.debug 131reinstall: kernel-reinstall 132reinstall.debug: kernel-reinstall.debug 133 134.if !defined(DEBUG) 135FULLKERNEL= ${KERNEL_KO} 136.else 137FULLKERNEL= ${KERNEL_KO}.debug 138${KERNEL_KO}: ${FULLKERNEL} 139 ${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL_KO} 140.endif 141 142${FULLKERNEL}: ${SYSTEM_DEP} vers.o 143 @rm -f ${.TARGET} 144 @echo linking ${.TARGET} 145 ${SYSTEM_LD} 146 ${SYSTEM_LD_TAIL} 147 148.if !exists(.depend) 149${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} 150.endif 151 152.for mfile in ${MFILES} 153${mfile:T:S/.m$/.h/}: ${mfile} 154 perl5 $S/kern/makeobjops.pl -h ${mfile} 155.endfor 156 157kernel-clean: 158 rm -f *.o *.so *.So *.ko *.s eddep errs \ 159 ${FULLKERNEL} ${KERNEL_KO} linterrs makelinks \ 160 setdef[01].c setdefs.h tags \ 161 vers.c vnode_if.c vnode_if.h \ 162 ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ 163 ${CLEAN} 164 165kernel-clobber: 166 find . -type f ! -name version -delete 167 168locore.o: $S/$M/$M/locore.s assym.s 169 ${NORMAL_S} 170 171# This is a hack. BFD "optimizes" away dynamic mode if there are no 172# dynamic references. We could probably do a '-Bforcedynamic' mode like 173# in the a.out ld. For now, this works. 174hack.So: Makefile 175 touch hack.c 176 ${CC} ${FMT} -shared -nostdlib hack.c -o hack.So 177 rm -f hack.c 178 179# this rule stops ./assym.s in .depend from causing problems 180./assym.s: assym.s 181 182assym.s: $S/kern/genassym.sh genassym.o 183 NM=${NM} OBJFORMAT=elf sh $S/kern/genassym.sh genassym.o > ${.TARGET} 184 185genassym.o: $S/$M/$M/genassym.c 186 ${CC} -c ${CFLAGS} -elf $S/$M/$M/genassym.c 187 188${SYSTEM_OBJS} genassym.o vers.o: opt_global.h 189 190kernel-depend: 191 rm -f ./machine ; ln -s $S/$M/include ./machine 192 rm -f .olddep 193 if [ -f .depend ]; then mv .depend .olddep; fi 194 ${MAKE} _kernel-depend 195 196_kernel-depend: assym.s vnode_if.h ${BEFORE_DEPEND} \ 197 ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ 198 ${SYSTEM_SFILES} ${MFILES:T:S/.m$/.h/} 199 if [ -f .olddep ]; then mv .olddep .depend; fi 200 rm -f .newdep 201 mkdep -a -f .newdep ${CFLAGS} ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} 202 env MKDEP_CPP="${CC} -E" \ 203 mkdep -a -f .newdep ${ASM_CFLAGS} ${SFILES} ${SYSTEM_SFILES} 204 rm -f .depend 205 mv .newdep .depend 206 207kernel-cleandepend: 208 rm -f .depend 209 210links: 211 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 212 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 213 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 214 sort -u | comm -23 - dontlink | \ 215 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 216 sh makelinks; rm -f dontlink 217 218kernel-tags: 219 @[ -f .depend ] || { echo "you must make depend first"; exit 1; } 220 sh $S/conf/systags.sh 221 rm -f tags1 222 sed -e 's, ../, ,' tags > tags1 223 224kernel-install kernel-install.debug: 225.if exists(${DESTDIR}/boot) 226 @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ 227 echo "You must set up a ${DESTDIR}/boot/device.hints file first." ; \ 228 exit 1 ; \ 229 fi 230 @if [ x"`grep device.hints ${DESTDIR}/boot/defaults/loader.conf ${DESTDIR}/boot/loader.conf`" = "x" ]; then \ 231 echo "You must activate /boot/device.hints in loader.conf." ; \ 232 exit 1 ; \ 233 fi 234.endif 235 @if [ ! -f ${KERNEL_KO}${.TARGET:S/kernel-install//} ] ; then \ 236 echo "You must build a kernel first." ; \ 237 exit 1 ; \ 238 fi 239.if exists(${DESTDIR}${KODIR}) 240.if exists(${DESTDIR}${KODIR}.old) 241 @-chflags -R noschg ${DESTDIR}${KODIR}.old 242 -rm -rf ${DESTDIR}${KODIR}.old 243.endif 244 mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old 245 [ "`sysctl -n kern.bootfile`" != "${DESTDIR}${KODIR}/kernel" ] || \ 246 sysctl kern.bootfile=${DESTDIR}${KODIR}.old/kernel 247.endif 248 mkdir -p ${DESTDIR}${KODIR} 249 install -c -m 555 -o root -g wheel \ 250 ${KERNEL_KO}${.TARGET:S/kernel-install//} ${DESTDIR}${KODIR} 251 252kernel-reinstall kernel-reinstall.debug: 253 @-chflags -R noschg ${DESTDIR}${KODIR} 254 install -c -m 555 -o root -g wheel \ 255 ${KERNEL_KO}${.TARGET:S/kernel-reinstall//} ${DESTDIR}${KODIR} 256 257.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) 258all: modules 259depend: modules-depend 260clean: modules-clean 261cleandepend: modules-cleandepend 262cleandir: modules-cleandir 263clobber: modules-clobber 264tags: modules-tags 265install: modules-install 266install.debug: modules-install.debug 267reinstall: modules-reinstall 268reinstall.debug: modules-reinstall.debug 269.endif 270 271MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} 272.if defined(MODULES_OVERRIDE) 273MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" 274.endif 275.if defined(DEBUG) 276MKMODULESENV+= DEBUG="${DEBUG}" DEBUG_FLAGS="${DEBUG}" 277.endif 278MKMODULESENV+= MACHINE=pc98 279 280modules: 281 @mkdir -p ${.OBJDIR}/modules 282 cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \ 283 env ${MKMODULESENV} ${MAKE} all 284 285modules-depend: 286 @mkdir -p ${.OBJDIR}/modules 287 cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \ 288 env ${MKMODULESENV} ${MAKE} depend 289 290modules-clean: 291 cd $S/modules ; env ${MKMODULESENV} ${MAKE} clean 292 293modules-cleandepend: 294 cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandepend 295 296modules-clobber: modules-clean 297 rm -rf ${MKMODULESENV} 298 299modules-cleandir: 300 cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandir 301 302modules-tags: 303 cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags 304 305modules-install modules-install.debug: 306 cd $S/modules ; env ${MKMODULESENV} ${MAKE} install 307 308modules-reinstall modules-reinstall.debug: 309 cd $S/modules ; env ${MKMODULESENV} ${MAKE} install 310 311config.o: 312 ${NORMAL_C} 313 314vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} 315 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 316 317# XXX strictly, everything depends on Makefile because changes to ${PROF} 318# only appear there, but we don't handle that. 319vers.o: 320 ${NORMAL_C} 321 322hints.o: hints.c 323 ${NORMAL_C} 324 325env.o: env.c 326 ${NORMAL_C} 327 328vnode_if.c: $S/kern/vnode_if.pl $S/kern/vnode_if.src 329 perl5 $S/kern/vnode_if.pl -c $S/kern/vnode_if.src 330 331vnode_if.h: $S/kern/vnode_if.pl $S/kern/vnode_if.src 332 perl5 $S/kern/vnode_if.pl -h $S/kern/vnode_if.src 333 334vnode_if.o: 335 ${NORMAL_C} 336 337# Commented out for now pending a better solution. 338# How do we pick up compiler version specific flags?? 339#.if exists($S/../share/mk) 340#.include "$S/../share/mk/bsd.kern.mk" 341#.else 342.include <bsd.kern.mk> 343#.endif 344 345%RULES
| 18# after which config should be rerun for all machines. 19# 20 21# Which version of config(8) is required. 22%VERSREQ= 500008 23 24# Can be overridden by makeoptions or /etc/make.conf 25KERNEL_KO?= kernel 26KERNEL?= kernel 27KODIR?= /boot/${KERNEL} 28#STD8X16FONT?= iso 29 30.if !defined(S) 31.if exists(./@/.) 32S= ./@ 33.else 34S= ../../.. 35.endif 36.endif 37M= ${MACHINE_ARCH} 38 39NM?= nm 40OBJCOPY?= objcopy 41SIZE?= size 42 43COPTFLAGS?=-O -pipe 44.if !defined(NO_CPU_COPTFLAGS) 45COPTFLAGS+= ${_CPUCFLAGS} 46.endif 47INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev 48 49# This hack lets us use the Intel ACPICA code without spamming a new 50# include path into 100+ source files. 51INCLUDES+= -I$S/contrib/dev/acpica 52 53# ... and the same for ipfilter 54INCLUDES+= -I$S/contrib/ipfilter 55 56# This hack is to allow kernel compiles to succeed on machines w/out srcdist 57.if exists($S/../include) 58INCLUDES+= -I$S/../include 59.else 60INCLUDES+= -I/usr/include 61.endif 62 63COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h 64CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} 65 66# XXX LOCORE means "don't declare C stuff" not "for locore.s". 67ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} 68 69# Select the correct set of tools. Can't set OBJFORMAT here because it 70# doesn't get exported into the environment, and if it were exported 71# then it might break building of utilities. 72FMT= -elf 73CFLAGS+= ${FMT} 74 75DEFINED_PROF= ${PROF} 76.if defined(PROF) 77CFLAGS+= -malign-functions=4 78.if ${PROFLEVEL} >= 2 79IDENT+= -DGPROF4 -DGUPROF 80PROF+= -mprofiler-epilogue 81.endif 82.endif 83 84# Put configuration-specific C flags last (except for ${PROF}) so that they 85# can override the others. 86CFLAGS+= ${CONF_CFLAGS} 87 88NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} 89NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC} 90NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${.IMPSRC} 91PROFILE_C= ${CC} -c ${CFLAGS} ${.IMPSRC} 92 93NORMAL_M= perl5 $S/kern/makeobjops.pl -c $<; \ 94 ${CC} -c ${CFLAGS} ${PROF} ${.PREFIX}.c 95 96GEN_CFILES= $S/$M/$M/genassym.c 97SYSTEM_CFILES= vnode_if.c hints.c env.c config.c 98SYSTEM_SFILES= $S/$M/$M/locore.s 99SYSTEM_DEP= Makefile ${SYSTEM_OBJS} 100SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} hints.o env.o config.o hack.So 101SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \ 102 -export-dynamic -dynamic-linker /red/herring \ 103 -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o 104SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ 105 ${SIZE} ${FMT} ${.TARGET} ; chmod 755 ${.TARGET} 106SYSTEM_DEP+= $S/conf/ldscript.$M 107 108%BEFORE_DEPEND 109 110%OBJS 111 112%FILES.c 113 114%FILES.s 115 116%FILES.m 117 118%CLEAN 119 120.PHONY: all modules 121 122all: ${KERNEL_KO} 123 124depend: kernel-depend 125clean: kernel-clean 126cleandepend: kernel-cleandepend 127clobber: kernel-clobber 128tags: kernel-tags 129install: kernel-install 130install.debug: kernel-install.debug 131reinstall: kernel-reinstall 132reinstall.debug: kernel-reinstall.debug 133 134.if !defined(DEBUG) 135FULLKERNEL= ${KERNEL_KO} 136.else 137FULLKERNEL= ${KERNEL_KO}.debug 138${KERNEL_KO}: ${FULLKERNEL} 139 ${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL_KO} 140.endif 141 142${FULLKERNEL}: ${SYSTEM_DEP} vers.o 143 @rm -f ${.TARGET} 144 @echo linking ${.TARGET} 145 ${SYSTEM_LD} 146 ${SYSTEM_LD_TAIL} 147 148.if !exists(.depend) 149${SYSTEM_OBJS}: vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/} 150.endif 151 152.for mfile in ${MFILES} 153${mfile:T:S/.m$/.h/}: ${mfile} 154 perl5 $S/kern/makeobjops.pl -h ${mfile} 155.endfor 156 157kernel-clean: 158 rm -f *.o *.so *.So *.ko *.s eddep errs \ 159 ${FULLKERNEL} ${KERNEL_KO} linterrs makelinks \ 160 setdef[01].c setdefs.h tags \ 161 vers.c vnode_if.c vnode_if.h \ 162 ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ 163 ${CLEAN} 164 165kernel-clobber: 166 find . -type f ! -name version -delete 167 168locore.o: $S/$M/$M/locore.s assym.s 169 ${NORMAL_S} 170 171# This is a hack. BFD "optimizes" away dynamic mode if there are no 172# dynamic references. We could probably do a '-Bforcedynamic' mode like 173# in the a.out ld. For now, this works. 174hack.So: Makefile 175 touch hack.c 176 ${CC} ${FMT} -shared -nostdlib hack.c -o hack.So 177 rm -f hack.c 178 179# this rule stops ./assym.s in .depend from causing problems 180./assym.s: assym.s 181 182assym.s: $S/kern/genassym.sh genassym.o 183 NM=${NM} OBJFORMAT=elf sh $S/kern/genassym.sh genassym.o > ${.TARGET} 184 185genassym.o: $S/$M/$M/genassym.c 186 ${CC} -c ${CFLAGS} -elf $S/$M/$M/genassym.c 187 188${SYSTEM_OBJS} genassym.o vers.o: opt_global.h 189 190kernel-depend: 191 rm -f ./machine ; ln -s $S/$M/include ./machine 192 rm -f .olddep 193 if [ -f .depend ]; then mv .depend .olddep; fi 194 ${MAKE} _kernel-depend 195 196_kernel-depend: assym.s vnode_if.h ${BEFORE_DEPEND} \ 197 ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ 198 ${SYSTEM_SFILES} ${MFILES:T:S/.m$/.h/} 199 if [ -f .olddep ]; then mv .olddep .depend; fi 200 rm -f .newdep 201 mkdep -a -f .newdep ${CFLAGS} ${CFILES} ${SYSTEM_CFILES} ${GEN_CFILES} 202 env MKDEP_CPP="${CC} -E" \ 203 mkdep -a -f .newdep ${ASM_CFLAGS} ${SFILES} ${SYSTEM_SFILES} 204 rm -f .depend 205 mv .newdep .depend 206 207kernel-cleandepend: 208 rm -f .depend 209 210links: 211 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 212 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 213 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 214 sort -u | comm -23 - dontlink | \ 215 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 216 sh makelinks; rm -f dontlink 217 218kernel-tags: 219 @[ -f .depend ] || { echo "you must make depend first"; exit 1; } 220 sh $S/conf/systags.sh 221 rm -f tags1 222 sed -e 's, ../, ,' tags > tags1 223 224kernel-install kernel-install.debug: 225.if exists(${DESTDIR}/boot) 226 @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ 227 echo "You must set up a ${DESTDIR}/boot/device.hints file first." ; \ 228 exit 1 ; \ 229 fi 230 @if [ x"`grep device.hints ${DESTDIR}/boot/defaults/loader.conf ${DESTDIR}/boot/loader.conf`" = "x" ]; then \ 231 echo "You must activate /boot/device.hints in loader.conf." ; \ 232 exit 1 ; \ 233 fi 234.endif 235 @if [ ! -f ${KERNEL_KO}${.TARGET:S/kernel-install//} ] ; then \ 236 echo "You must build a kernel first." ; \ 237 exit 1 ; \ 238 fi 239.if exists(${DESTDIR}${KODIR}) 240.if exists(${DESTDIR}${KODIR}.old) 241 @-chflags -R noschg ${DESTDIR}${KODIR}.old 242 -rm -rf ${DESTDIR}${KODIR}.old 243.endif 244 mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old 245 [ "`sysctl -n kern.bootfile`" != "${DESTDIR}${KODIR}/kernel" ] || \ 246 sysctl kern.bootfile=${DESTDIR}${KODIR}.old/kernel 247.endif 248 mkdir -p ${DESTDIR}${KODIR} 249 install -c -m 555 -o root -g wheel \ 250 ${KERNEL_KO}${.TARGET:S/kernel-install//} ${DESTDIR}${KODIR} 251 252kernel-reinstall kernel-reinstall.debug: 253 @-chflags -R noschg ${DESTDIR}${KODIR} 254 install -c -m 555 -o root -g wheel \ 255 ${KERNEL_KO}${.TARGET:S/kernel-reinstall//} ${DESTDIR}${KODIR} 256 257.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) 258all: modules 259depend: modules-depend 260clean: modules-clean 261cleandepend: modules-cleandepend 262cleandir: modules-cleandir 263clobber: modules-clobber 264tags: modules-tags 265install: modules-install 266install.debug: modules-install.debug 267reinstall: modules-reinstall 268reinstall.debug: modules-reinstall.debug 269.endif 270 271MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} 272.if defined(MODULES_OVERRIDE) 273MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" 274.endif 275.if defined(DEBUG) 276MKMODULESENV+= DEBUG="${DEBUG}" DEBUG_FLAGS="${DEBUG}" 277.endif 278MKMODULESENV+= MACHINE=pc98 279 280modules: 281 @mkdir -p ${.OBJDIR}/modules 282 cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \ 283 env ${MKMODULESENV} ${MAKE} all 284 285modules-depend: 286 @mkdir -p ${.OBJDIR}/modules 287 cd $S/modules ; env ${MKMODULESENV} ${MAKE} obj ; \ 288 env ${MKMODULESENV} ${MAKE} depend 289 290modules-clean: 291 cd $S/modules ; env ${MKMODULESENV} ${MAKE} clean 292 293modules-cleandepend: 294 cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandepend 295 296modules-clobber: modules-clean 297 rm -rf ${MKMODULESENV} 298 299modules-cleandir: 300 cd $S/modules ; env ${MKMODULESENV} ${MAKE} cleandir 301 302modules-tags: 303 cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags 304 305modules-install modules-install.debug: 306 cd $S/modules ; env ${MKMODULESENV} ${MAKE} install 307 308modules-reinstall modules-reinstall.debug: 309 cd $S/modules ; env ${MKMODULESENV} ${MAKE} install 310 311config.o: 312 ${NORMAL_C} 313 314vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP} 315 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 316 317# XXX strictly, everything depends on Makefile because changes to ${PROF} 318# only appear there, but we don't handle that. 319vers.o: 320 ${NORMAL_C} 321 322hints.o: hints.c 323 ${NORMAL_C} 324 325env.o: env.c 326 ${NORMAL_C} 327 328vnode_if.c: $S/kern/vnode_if.pl $S/kern/vnode_if.src 329 perl5 $S/kern/vnode_if.pl -c $S/kern/vnode_if.src 330 331vnode_if.h: $S/kern/vnode_if.pl $S/kern/vnode_if.src 332 perl5 $S/kern/vnode_if.pl -h $S/kern/vnode_if.src 333 334vnode_if.o: 335 ${NORMAL_C} 336 337# Commented out for now pending a better solution. 338# How do we pick up compiler version specific flags?? 339#.if exists($S/../share/mk) 340#.include "$S/../share/mk/bsd.kern.mk" 341#.else 342.include <bsd.kern.mk> 343#.endif 344 345%RULES
|