Module Name: src Committed By: pooka Date: Sun Mar 21 06:55:45 UTC 2010
Modified Files: src/sys/rump: Makefile.rump Added Files: src/share/mk: bsd.ioconf.mk Log Message: Move make snippets for use with config(1) ioconf functionality from rump into share/mk. This is to make it useful for all kernel builders. Note: we have waaay too many weird and wonderful ways of making kernel code (monolithic kernel, modules, rump). There should be only one way to build kernel code instead of a maze of twisty little .mk files, all not quite alike. When that is fixed, this snippet can go into the more generic .mk file. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/mk/bsd.ioconf.mk cvs rdiff -u -r1.52 -r1.53 src/sys/rump/Makefile.rump Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.52 src/sys/rump/Makefile.rump:1.53 --- src/sys/rump/Makefile.rump:1.52 Mon Mar 1 15:41:15 2010 +++ src/sys/rump/Makefile.rump Sun Mar 21 06:55:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.52 2010/03/01 15:41:15 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.53 2010/03/21 06:55:44 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -102,21 +102,8 @@ ${AR} ${_ARRANFL} ${.TARGET} .endif -# If IOCONF is defined, autocreate ioconf.c and locators.h. -# This is useful mainly for devices. -.if !empty(IOCONF) -ioconf.c: ${IOCONF} - ${TOOL_CONFIG} -b ${.OBJDIR} -s ${RUMPTOP}/.. ${.CURDIR}/${IOCONF} - # config doesn't change the files if they're unchanged. however, - # here we want to satisfy our make dependency, so force a - # timestamp update - touch ioconf.c locators.h - -locators.h: ioconf.c - -CLEANFILES+= ioconf.c locators.h -DPSRCS+= ioconf.c locators.h -.endif +_BSD_IOCONF_MK_USER_=1 +.include <bsd.ioconf.mk> .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc" .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc" Added files: Index: src/share/mk/bsd.ioconf.mk diff -u /dev/null src/share/mk/bsd.ioconf.mk:1.1 --- /dev/null Sun Mar 21 06:55:45 2010 +++ src/share/mk/bsd.ioconf.mk Sun Mar 21 06:55:45 2010 @@ -0,0 +1,31 @@ +# $NetBSD: bsd.ioconf.mk,v 1.1 2010/03/21 06:55:45 pooka Exp $ +# + +# If IOCONF is defined, autocreate ioconf.c and locators.h. +# This is useful mainly for devices. +.if !empty(IOCONF) + +# discourage direct inclusion. bsd.ioconf.mk will hopefully go away +# when the kernel build procedures are unified. +.if defined(_BSD_IOCONF_MK_USER_) + +ioconf.c: ${IOCONF} + ${TOOL_CONFIG} -b ${.OBJDIR} -s ${S} ${.CURDIR}/${IOCONF} + # config doesn't change the files if they're unchanged. however, + # here we want to satisfy our make dependency, so force a + # timestamp update + touch ioconf.c locators.h + +.else # _BSD_IOCONF_MK_USER_ + +ioconf.c: + @echo do not include bsd.ioconf.mk directly + @false + +.endif # _BSD_IOCONF_MK_USER_ + +locators.h: ioconf.c + +CLEANFILES+= ioconf.c locators.h +DPSRCS+= ioconf.c locators.h +.endif