diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 02:41:29 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-15 02:41:29 +0000 |
commit | 8e0c7f5debe7a0ead34d65329ce61ee4dbd2f948 (patch) | |
tree | 677476a3096a7e5d513e80476c8cbcfd0ec2d52d /sys | |
parent | c35320aff562c4faf4cb68f4e060b4dc3594b1ca (diff) |
Convert the kernel Makefiles to autogenerate dependencies during compilation
using the -MD option to cc, with -MP, -MT, and -MF where needed, converting
"make depend" to a no-op. This increases parallelism for those using "make -j"
and keeps the dependencies up to date with each compilation automatically.
sparc and vax users will need to rebuild gcc with support for the
-M[PTF] options before config'ing with this diff.
Diffstat (limited to 'sys')
27 files changed, 729 insertions, 513 deletions
diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha index eb485f74fb5..5e866b24cb5 100644 --- a/sys/arch/alpha/conf/Makefile.alpha +++ b/sys/arch/alpha/conf/Makefile.alpha @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.alpha,v 1.73 2010/12/30 18:49:29 deraadt Exp $ +# $OpenBSD: Makefile.alpha,v 1.74 2011/04/15 02:41:27 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -156,4 +152,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index db19bf5f809..46e5299112b 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.amd64,v 1.47 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.amd64,v 1.48 2011/04/15 02:41:27 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -69,7 +69,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -89,10 +90,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -121,25 +128,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -158,4 +154,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/armish/conf/Makefile.armish b/sys/arch/armish/conf/Makefile.armish index 7cc19a58884..9500e51b569 100644 --- a/sys/arch/armish/conf/Makefile.armish +++ b/sys/arch/armish/conf/Makefile.armish @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armish,v 1.38 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.armish,v 1.39 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD_HEAD+=; \ cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ @@ -97,10 +98,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -129,25 +136,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/${_mach}_start.S ${_archdir}/${_arch}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -168,4 +164,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/aviion/conf/Makefile.aviion b/sys/arch/aviion/conf/Makefile.aviion index c72d1725a67..1f573b5fc5c 100644 --- a/sys/arch/aviion/conf/Makefile.aviion +++ b/sys/arch/aviion/conf/Makefile.aviion @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.aviion,v 1.33 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.aviion,v 1.34 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -74,7 +74,8 @@ PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \ # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -94,10 +95,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -126,25 +133,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -163,4 +159,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/beagle/conf/Makefile.beagle b/sys/arch/beagle/conf/Makefile.beagle index e55dbb1d342..2d429d93637 100644 --- a/sys/arch/beagle/conf/Makefile.beagle +++ b/sys/arch/beagle/conf/Makefile.beagle @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.beagle,v 1.32 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.beagle,v 1.33 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD_HEAD+=; \ cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ @@ -93,10 +94,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -125,25 +132,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/${_mach}_start.S ${_archdir}/${_arch}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -164,4 +160,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/gumstix/conf/Makefile.gumstix b/sys/arch/gumstix/conf/Makefile.gumstix index a309621b2d9..11a5fe8b2a1 100644 --- a/sys/arch/gumstix/conf/Makefile.gumstix +++ b/sys/arch/gumstix/conf/Makefile.gumstix @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.gumstix,v 1.30 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.gumstix,v 1.31 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD_HEAD+=; \ cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ @@ -93,10 +94,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -125,25 +132,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/${_mach}_start.S ${_archdir}/${_arch}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -164,4 +160,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/hp300/conf/Makefile.hp300 b/sys/arch/hp300/conf/Makefile.hp300 index 6829b8f4398..079ab37fb21 100644 --- a/sys/arch/hp300/conf/Makefile.hp300 +++ b/sys/arch/hp300/conf/Makefile.hp300 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.hp300,v 1.73 2010/12/30 18:49:30 deraadt Exp $ +# $OpenBSD: Makefile.hp300,v 1.74 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -105,7 +105,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o ${FPSP} -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -125,10 +126,16 @@ LINKFLAGS+= -S %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -157,25 +164,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -194,4 +190,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/hppa/conf/Makefile.hppa b/sys/arch/hppa/conf/Makefile.hppa index 821b913ccc3..7549ac8c239 100644 --- a/sys/arch/hppa/conf/Makefile.hppa +++ b/sys/arch/hppa/conf/Makefile.hppa @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.hppa,v 1.64 2011/04/10 02:54:45 deraadt Exp $ +# $OpenBSD: Makefile.hppa,v 1.65 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -78,7 +78,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -97,10 +98,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -130,25 +137,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -167,4 +163,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/hppa64/conf/Makefile.hppa64 b/sys/arch/hppa64/conf/Makefile.hppa64 index 294a6f572f8..863b8f4a3cb 100644 --- a/sys/arch/hppa64/conf/Makefile.hppa64 +++ b/sys/arch/hppa64/conf/Makefile.hppa64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.hppa64,v 1.37 2011/04/10 03:03:29 deraadt Exp $ +# $OpenBSD: Makefile.hppa64,v 1.38 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -70,7 +70,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -89,10 +90,16 @@ LINKFLAGS+= -S %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -121,25 +128,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -158,4 +154,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index e034d57f8f9..84e79021283 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.79 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.i386,v 1.80 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -74,7 +74,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -94,10 +95,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -126,25 +133,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -163,4 +159,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/landisk/conf/Makefile.landisk b/sys/arch/landisk/conf/Makefile.landisk index 5c4a01b4fd8..859c3377e5e 100644 --- a/sys/arch/landisk/conf/Makefile.landisk +++ b/sys/arch/landisk/conf/Makefile.landisk @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.landisk,v 1.40 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.landisk,v 1.41 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/loongson/conf/Makefile.loongson b/sys/arch/loongson/conf/Makefile.loongson index 3ced1ebe183..ef8702a75b5 100644 --- a/sys/arch/loongson/conf/Makefile.loongson +++ b/sys/arch/loongson/conf/Makefile.loongson @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.loongson,v 1.29 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.loongson,v 1.30 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -30,7 +30,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -75,7 +75,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -95,10 +96,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -131,25 +138,14 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw grep -v '^#' ${_machdir}/${_mach}/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -169,4 +165,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k index d90e9543c72..d2a32ac57de 100644 --- a/sys/arch/luna88k/conf/Makefile.luna88k +++ b/sys/arch/luna88k/conf/Makefile.luna88k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.luna88k,v 1.40 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.luna88k,v 1.41 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -72,7 +72,8 @@ PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \ # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -92,10 +93,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -124,25 +131,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -161,4 +157,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/mac68k/conf/Makefile.mac68k b/sys/arch/mac68k/conf/Makefile.mac68k index 887dd8e69a9..cac01ca8c30 100644 --- a/sys/arch/mac68k/conf/Makefile.mac68k +++ b/sys/arch/mac68k/conf/Makefile.mac68k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.mac68k,v 1.70 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.mac68k,v 1.71 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -70,7 +70,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o ${FPSP} -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -90,10 +91,16 @@ LINKFLAGS+= -S %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -122,25 +129,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -159,4 +155,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc index 27f57a837f3..bc75d8a982f 100644 --- a/sys/arch/macppc/conf/Makefile.macppc +++ b/sys/arch/macppc/conf/Makefile.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.macppc,v 1.59 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.macppc,v 1.60 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/mvme68k/conf/Makefile.mvme68k b/sys/arch/mvme68k/conf/Makefile.mvme68k index 203b031f657..a796544f7ae 100644 --- a/sys/arch/mvme68k/conf/Makefile.mvme68k +++ b/sys/arch/mvme68k/conf/Makefile.mvme68k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.mvme68k,v 1.61 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.mvme68k,v 1.62 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -71,7 +71,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o ${FPSP} ${060SP} -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -91,10 +92,16 @@ LINKFLAGS+= -S %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -123,25 +130,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -160,4 +156,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/mvme88k/conf/Makefile.mvme88k b/sys/arch/mvme88k/conf/Makefile.mvme88k index 5f22293e220..1d28011917f 100644 --- a/sys/arch/mvme88k/conf/Makefile.mvme88k +++ b/sys/arch/mvme88k/conf/Makefile.mvme88k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.mvme88k,v 1.70 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.mvme88k,v 1.71 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -69,7 +69,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} # Kernel is linked as a ZMAGIC executable, with start at 10020 SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -89,10 +90,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -121,25 +128,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -158,4 +154,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/mvmeppc/conf/Makefile.mvmeppc b/sys/arch/mvmeppc/conf/Makefile.mvmeppc index 395fc7de492..5304224ebeb 100644 --- a/sys/arch/mvmeppc/conf/Makefile.mvmeppc +++ b/sys/arch/mvmeppc/conf/Makefile.mvmeppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.mvmeppc,v 1.56 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.mvmeppc,v 1.57 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/octeon/conf/Makefile.octeon b/sys/arch/octeon/conf/Makefile.octeon index 88612147872..b055cb1de7d 100644 --- a/sys/arch/octeon/conf/Makefile.octeon +++ b/sys/arch/octeon/conf/Makefile.octeon @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.octeon,v 1.4 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.octeon,v 1.5 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -30,7 +30,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -76,7 +76,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -95,10 +96,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -131,25 +138,14 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw grep -v '^#' ${_machdir}/${_mach}/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -169,4 +165,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/palm/conf/Makefile.palm b/sys/arch/palm/conf/Makefile.palm index e2477cb491c..4e67764101f 100644 --- a/sys/arch/palm/conf/Makefile.palm +++ b/sys/arch/palm/conf/Makefile.palm @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.palm,v 1.27 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.palm,v 1.28 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD_HEAD+=; \ cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ @@ -93,10 +94,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -125,25 +132,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/${_mach}_start.S ${_archdir}/${_arch}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -164,4 +160,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/sgi/conf/Makefile.sgi b/sys/arch/sgi/conf/Makefile.sgi index c561cfc9a7d..c1e2b1aaa61 100644 --- a/sys/arch/sgi/conf/Makefile.sgi +++ b/sys/arch/sgi/conf/Makefile.sgi @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sgi,v 1.51 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.sgi,v 1.52 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -30,7 +30,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -75,7 +75,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -95,10 +96,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -131,25 +138,14 @@ symbols.sort: ${_machdir}/${_mach}/symbols.raw grep -v '^#' ${_machdir}/${_mach}/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -169,4 +165,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/socppc/conf/Makefile.socppc b/sys/arch/socppc/conf/Makefile.socppc index 52a3c373ad4..ad99ceeef63 100644 --- a/sys/arch/socppc/conf/Makefile.socppc +++ b/sys/arch/socppc/conf/Makefile.socppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.socppc,v 1.30 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.socppc,v 1.31 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/solbourne/conf/Makefile.solbourne b/sys/arch/solbourne/conf/Makefile.solbourne index 85096060c90..80d0391933f 100644 --- a/sys/arch/solbourne/conf/Makefile.solbourne +++ b/sys/arch/solbourne/conf/Makefile.solbourne @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.solbourne,v 1.33 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.solbourne,v 1.34 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -156,4 +152,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/sparc/conf/Makefile.sparc b/sys/arch/sparc/conf/Makefile.sparc index 2165a805a78..37cb471a4d8 100644 --- a/sys/arch/sparc/conf/Makefile.sparc +++ b/sys/arch/sparc/conf/Makefile.sparc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc,v 1.69 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.sparc,v 1.70 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -71,7 +71,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -91,10 +92,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -123,25 +130,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -160,4 +156,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64 index d3d2d4e55b5..5fc6ff3fb01 100644 --- a/sys/arch/sparc64/conf/Makefile.sparc64 +++ b/sys/arch/sparc64/conf/Makefile.sparc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc64,v 1.56 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.sparc64,v 1.57 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.s -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax index 384d8fe64a9..11227d099b4 100644 --- a/sys/arch/vax/conf/Makefile.vax +++ b/sys/arch/vax/conf/Makefile.vax @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.vax,v 1.61 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.vax,v 1.62 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -88,10 +89,16 @@ LINKFLAGS+= -S %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -120,25 +127,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -157,4 +153,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES diff --git a/sys/arch/zaurus/conf/Makefile.zaurus b/sys/arch/zaurus/conf/Makefile.zaurus index b50b1aa070f..4f6729d3ccf 100644 --- a/sys/arch/zaurus/conf/Makefile.zaurus +++ b/sys/arch/zaurus/conf/Makefile.zaurus @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.zaurus,v 1.40 2010/12/30 18:49:31 deraadt Exp $ +# $OpenBSD: Makefile.zaurus,v 1.41 2011/04/15 02:41:28 guenther Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -23,7 +23,7 @@ _machdir?= $S/arch/${_mach} _archdir?= $S/arch/${_arch} INCLUDES= -nostdinc -I. -I$S -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ +CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wno-main -Wno-uninitialized -Wno-format \ -Wstack-larger-than-2047 @@ -68,7 +68,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_HEAD} ${OBJS} +SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD_HEAD+=; \ cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ @@ -93,10 +94,16 @@ LINKFLAGS+= -x %LOAD +# cc's -MD puts the source and output paths in the dependency file; +# since those are temp files here we need to fix it up. It also +# puts the file in /tmp, so we use -MF to put it in the current +# directory as assym.P and then generate assym.d from it with a +# good target name assym.h: $S/kern/genassym.sh Makefile \ ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} > assym.h.tmp + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp + sed '1s/.*/assym.h: \\/' assym.P > assym.d sort -u assym.h.tmp > assym.h param.c: $S/conf/param.c @@ -125,25 +132,14 @@ lint: ${CFILES} ioconf.c param.c | \ grep -v 'static function .* unused' +depend: + @touch $@ + tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/${_mach}_start.S ${_archdir}/${_arch}/locore.S -depend:: .depend -.depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} - ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} - ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} -.if !empty(SFILES) - ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} -.endif - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} ${CPPFLAGS} - @sed -e 's/.*\.o: /assym.h: /' -e 's/\/tmp\/genassym_c.[^ ]*//' \ - < assym.dep >> .depend - @rm -f assym.dep - db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk - ${CC} ${CFLAGS} ${CPPFLAGS} -gstabs -c $S/ddb/db_structinfo.c + ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o @@ -164,4 +160,16 @@ install-kernel-${MACHINE_NAME}: mv /nbsd /bsd .endif +# pull in the dependency information +.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) + ${SYSTEM_OBJ}: ${DB_STRUCTINFO} +.endif +.ifnmake clean +. for o in ${SYSTEM_OBJ:.o=.d} assym.d ${DB_STRUCTINFO:.h=.d} +. if exists($o) +. include "$o" +. endif +. endfor +.endif + %RULES |