xref: /openbsd/sys/arch/i386/Makefile (revision 8932bfb7)
1#	$OpenBSD: Makefile,v 1.20 2010/11/12 17:11:44 deraadt Exp $
2
3S=	${.CURDIR}/../..
4KFILE=	GENERIC
5.if exists(conf/GENERIC.MP)
6KFILE=	GENERIC.MP
7.endif
8TDIRS=	${_arch} include pci isa eisa
9TAGS=	${.CURDIR}/tags
10
11NOPROG=
12NOMAN=
13SUBDIR=	stand
14
15# config the fattest kernel we can find into a temporary dir
16# to create a Makefile.  Then use make to pull some variables
17# out and push them into the sub-shell to expand the paths,
18# and finally run ctags.
19tags::
20	TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \
21	eval "S=${S}" && \
22	config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \
23	eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \
24	eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \
25	eval "_machdir=\$S/arch/$${_mach}" && \
26	eval "_archdir=\$S/arch/$${_arch}" && \
27	eval "HFILES=\"`find $S \( -path $S/'arch' -o -path $S/stand -o -path $S/lib/libsa -o -path $S'/lib/libkern/arch' \) -prune -o -name '*.h'; find $${_machdir} $${_archdir} $S/lib/libkern/arch/$${_mach} \( -name boot -o -name stand \) -prune -o -name '*.h'`\"" && \
28	eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \
29	eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \
30	eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \
31	ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \
32	egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \
33	    sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3	\\1	/^\\2(\\3\\4$$/;" \
34	    >> ${TAGS} && \
35	sort -o ${TAGS} ${TAGS} && \
36	rm -rf $${TDIR}
37
38links:
39	-for i in conf ${TDIRS}; do \
40	    (cd $$i && rm -f tags; ln -s tags tags); done
41
42obj:	_SUBDIRUSE
43
44.include <bsd.prog.mk>
45