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