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