1#	$NetBSD: bsd.ioconf.mk,v 1.2 2010/03/22 14:42:01 pooka Exp $
2#
3
4.include <bsd.own.mk>
5
6# If IOCONF is defined, autocreate ioconf.[ch] and locators.h.
7# This is useful mainly for devices.
8.if !empty(IOCONF)
9
10# discourage direct inclusion.  bsd.ioconf.mk will hopefully go away
11# when the kernel build procedures are unified.
12.if defined(_BSD_IOCONF_MK_USER_)
13
14# XXX: ioconf.c doesn't need to depend on TOOL_CONFIG, but that helps
15# keep builds working while hashing out some of the experimental
16# features related to ioconf.
17.if ${USETOOLS} == "yes"
18CONFIGDEP=${TOOL_CONFIG}
19.endif
20ioconf.c: ${IOCONF} ${CONFIGDEP}
21	${TOOL_CONFIG} -b ${.OBJDIR} -s ${S} ${.CURDIR}/${IOCONF}
22	# config doesn't change the files if they're unchanged.  however,
23	# here we want to satisfy our make dependency, so force a
24	# timestamp update
25	touch ioconf.c ioconf.h locators.h
26
27.else # _BSD_IOCONF_MK_USER_
28
29ioconf.c:
30	@echo do not include bsd.ioconf.mk directly
31	@false
32
33.endif # _BSD_IOCONF_MK_USER_
34
35locators.h: ioconf.c
36ioconf.h: ioconf.c
37
38CLEANFILES+= ioconf.c ioconf.h locators.h
39DPSRCS+= ioconf.c ioconf.h locators.h
40.endif
41