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