xref: /openbsd/sys/arch/sparc64/Makefile (revision e3c6d6b3)
1*e3c6d6b3Sderaadt#	$OpenBSD: Makefile,v 1.6 2010/11/12 17:11:44 deraadt Exp $
2275d912eSmickey
3275d912eSmickeyS=	${.CURDIR}/../..
48ea62d2bSderaadtKFILE=	GENERIC
58ea62d2bSderaadt.if exists(conf/GENERIC.MP)
68ea62d2bSderaadtKFILE=	GENERIC.MP
78ea62d2bSderaadt.endif
88ea62d2bSderaadtTDIRS=	${_arch} include pci isa eisa
98ea62d2bSderaadtTAGS=	${.CURDIR}/tags
1045b689e3Sart
118ea62d2bSderaadtNOPROG=
128ea62d2bSderaadtNOMAN=
1345b689e3SartSUBDIR=	stand
1445b689e3Sart
158ea62d2bSderaadt# config the fattest kernel we can find into a temporary dir
168ea62d2bSderaadt# to create a Makefile.  Then use make to pull some variables
178ea62d2bSderaadt# out and push them into the sub-shell to expand the paths,
188ea62d2bSderaadt# and finally run ctags.
198ea62d2bSderaadttags::
208ea62d2bSderaadt	TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \
218ea62d2bSderaadt	eval "S=${S}" && \
228ea62d2bSderaadt	config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \
238ea62d2bSderaadt	eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \
248ea62d2bSderaadt	eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \
258ea62d2bSderaadt	eval "_machdir=\$S/arch/$${_mach}" && \
268ea62d2bSderaadt	eval "_archdir=\$S/arch/$${_arch}" && \
27*e3c6d6b3Sderaadt	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'`\"" && \
288ea62d2bSderaadt	eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \
298ea62d2bSderaadt	eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \
308ea62d2bSderaadt	eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \
31*e3c6d6b3Sderaadt	ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \
328ea62d2bSderaadt	egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \
338ea62d2bSderaadt	    sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3	\\1	/^\\2(\\3\\4$$/;" \
348ea62d2bSderaadt	    >> ${TAGS} && \
358ea62d2bSderaadt	sort -o ${TAGS} ${TAGS} && \
368ea62d2bSderaadt	rm -rf $${TDIR}
3745b689e3Sart
3845b689e3Sartlinks:
398ea62d2bSderaadt	-for i in conf ${TDIRS}; do \
408ea62d2bSderaadt	    (cd $$i && rm -f tags; ln -s tags tags); done
4145b689e3Sart
4245b689e3Sartobj:	_SUBDIRUSE
4345b689e3Sart
4445b689e3Sart.include <bsd.prog.mk>
45