xref: /openbsd/sys/arch/sparc64/Makefile (revision 7b474003)
1*7b474003Stb#	$OpenBSD: Makefile,v 1.10 2017/01/22 03:27:31 tb Exp $
2*7b474003Stb
3*7b474003Stb.include <bsd.own.mk>    # for KEEPKERNELS
4275d912eSmickey
5275d912eSmickeyS=	${.CURDIR}/../..
68ea62d2bSderaadtKFILE=	GENERIC
78ea62d2bSderaadt.if exists(conf/GENERIC.MP)
88ea62d2bSderaadtKFILE=	GENERIC.MP
98ea62d2bSderaadt.endif
10ee8f9acaSjasperTDIRS=	${_arch} include fpu
118ea62d2bSderaadtTAGS=	${.CURDIR}/tags
1245b689e3Sart
138ea62d2bSderaadtNOPROG=
148ea62d2bSderaadtNOMAN=
1500497930SespieNOOBJ=
16*7b474003StbSUBDIR=	stand
17*7b474003Stb.if !defined(KEEPKERNELS) || !(make(clean) || make(cleandir))
18*7b474003StbSUBDIR+=compile
19*7b474003Stb.endif
2045b689e3Sart
218ea62d2bSderaadt# config the fattest kernel we can find into a temporary dir
228ea62d2bSderaadt# to create a Makefile.  Then use make to pull some variables
238ea62d2bSderaadt# out and push them into the sub-shell to expand the paths,
248ea62d2bSderaadt# and finally run ctags.
258ea62d2bSderaadttags::
268ea62d2bSderaadt	TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \
278ea62d2bSderaadt	eval "S=${S}" && \
288ea62d2bSderaadt	config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \
298ea62d2bSderaadt	eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \
308ea62d2bSderaadt	eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \
318ea62d2bSderaadt	eval "_machdir=\$S/arch/$${_mach}" && \
328ea62d2bSderaadt	eval "_archdir=\$S/arch/$${_arch}" && \
33e3c6d6b3Sderaadt	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'`\"" && \
348ea62d2bSderaadt	eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \
358ea62d2bSderaadt	eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \
368ea62d2bSderaadt	eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \
37e3c6d6b3Sderaadt	ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \
388ea62d2bSderaadt	egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \
398ea62d2bSderaadt	    sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3	\\1	/^\\2(\\3\\4$$/;" \
408ea62d2bSderaadt	    >> ${TAGS} && \
418ea62d2bSderaadt	sort -o ${TAGS} ${TAGS} && \
428ea62d2bSderaadt	rm -rf $${TDIR}
4345b689e3Sart
4445b689e3Sartlinks:
458ea62d2bSderaadt	-for i in conf ${TDIRS}; do \
468ea62d2bSderaadt	    (cd $$i && rm -f tags; ln -s tags tags); done
4745b689e3Sart
4845b689e3Sartobj:	_SUBDIRUSE
4945b689e3Sart
5045b689e3Sart.include <bsd.prog.mk>
51