xref: /minix3/share/mk/bsd.ioconf.mk (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#	$NetBSD: bsd.ioconf.mk,v 1.5 2014/11/30 15:53:29 uebayasi Exp $
29152e1c5SLionel Sambuc#
39152e1c5SLionel Sambuc
49152e1c5SLionel Sambuc.include <bsd.own.mk>
59152e1c5SLionel Sambuc
69152e1c5SLionel Sambuc# If IOCONF is defined, autocreate ioconf.[ch] and locators.h.
79152e1c5SLionel Sambuc# This is useful mainly for devices.
89152e1c5SLionel Sambuc.if !empty(IOCONF)
99152e1c5SLionel Sambuc
109152e1c5SLionel Sambuc# discourage direct inclusion.  bsd.ioconf.mk will hopefully go away
119152e1c5SLionel Sambuc# when the kernel build procedures are unified.
129152e1c5SLionel Sambuc.if defined(_BSD_IOCONF_MK_USER_)
139152e1c5SLionel Sambuc
149152e1c5SLionel Sambuc# XXX: ioconf.c doesn't need to depend on TOOL_CONFIG, but that helps
159152e1c5SLionel Sambuc# keep builds working while hashing out some of the experimental
169152e1c5SLionel Sambuc# features related to ioconf.
179152e1c5SLionel Sambuc.if ${USETOOLS} == "yes"
189152e1c5SLionel SambucCONFIGDEP=${TOOL_CONFIG}
199152e1c5SLionel Sambuc.endif
209152e1c5SLionel Sambucioconf.c: ${IOCONF} ${CONFIGDEP}
21*0a6a1f1dSLionel Sambuc	${TOOL_CONFIG} ${CONFIGOPTS} -b ${.OBJDIR} -s ${S} \
22*0a6a1f1dSLionel Sambuc	    ${IOCONFDIR:U${.CURDIR}}/${IOCONF}
239152e1c5SLionel Sambuc	# config doesn't change the files if they're unchanged.  however,
249152e1c5SLionel Sambuc	# here we want to satisfy our make dependency, so force a
259152e1c5SLionel Sambuc	# timestamp update
269152e1c5SLionel Sambuc	touch ioconf.c ioconf.h locators.h
279152e1c5SLionel Sambuc
289152e1c5SLionel Sambuc.else # _BSD_IOCONF_MK_USER_
299152e1c5SLionel Sambuc
309152e1c5SLionel Sambucioconf.c:
319152e1c5SLionel Sambuc	@echo do not include bsd.ioconf.mk directly
329152e1c5SLionel Sambuc	@false
339152e1c5SLionel Sambuc
349152e1c5SLionel Sambuc.endif # _BSD_IOCONF_MK_USER_
359152e1c5SLionel Sambuc
369152e1c5SLionel Sambuclocators.h: ioconf.c
379152e1c5SLionel Sambucioconf.h: ioconf.c
389152e1c5SLionel Sambuc
399152e1c5SLionel SambucCLEANFILES+= ioconf.c ioconf.h locators.h
409152e1c5SLionel SambucDPSRCS+= ioconf.c ioconf.h locators.h
419152e1c5SLionel Sambuc.endif
42