1*7b474003Stb# $OpenBSD: Makefile,v 1.23 2017/01/22 03:27:31 tb Exp $ 2*7b474003Stb 3*7b474003Stb.include <bsd.own.mk> # for KEEPKERNELS 4df930be7Sderaadt 5275d912eSmickeyS= ${.CURDIR}/../.. 68ea62d2bSderaadtKFILE= GENERIC 78ea62d2bSderaadt.if exists(conf/GENERIC.MP) 88ea62d2bSderaadtKFILE= GENERIC.MP 98ea62d2bSderaadt.endif 108ea62d2bSderaadtTDIRS= ${_arch} include pci isa eisa 118ea62d2bSderaadtTAGS= ${.CURDIR}/tags 128abd6d47Stholo 138ea62d2bSderaadtNOPROG= 148ea62d2bSderaadtNOMAN= 1500497930SespieNOOBJ= 16*7b474003StbSUBDIR= stand 17*7b474003Stb.if !defined(KEEPKERNELS) || !(make(clean) || make(cleandir)) 18*7b474003StbSUBDIR+=compile 19*7b474003Stb.endif 20df930be7Sderaadt 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} 43df930be7Sderaadt 44df930be7Sderaadtlinks: 458ea62d2bSderaadt -for i in conf ${TDIRS}; do \ 468ea62d2bSderaadt (cd $$i && rm -f tags; ln -s tags tags); done 47df930be7Sderaadt 48df930be7Sderaadtobj: _SUBDIRUSE 49df930be7Sderaadt 508ea62d2bSderaadt.include <bsd.prog.mk> 51