diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-05-31 22:21:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-05-31 22:21:45 +0000 |
commit | 5a95f7ec91d73027a0cb3cfad969e67da84aa980 (patch) | |
tree | 3dc0482b21e6cce79dc71912a2fac336fe24694c /sys/arch/hp300 | |
parent | a28226240cd918c9b04e30eb6121cf4a6b7f5e5a (diff) |
Completely rewrite the tags file creation process. use config(8) against
a fat kernel (GERERIC or GENERIC.MP) into a temporary dir, then extract some
variables using make -V, and after some more singing and dancing use this
full and (more) correct list of files with ctags. Don't read this code.
ok guenther
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/Makefile | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/sys/arch/hp300/Makefile b/sys/arch/hp300/Makefile index e47c4ba6b9f..0170779dc28 100644 --- a/sys/arch/hp300/Makefile +++ b/sys/arch/hp300/Makefile @@ -1,38 +1,43 @@ -# $OpenBSD: Makefile,v 1.8 2005/05/06 11:16:47 pedro Exp $ -# $NetBSD: Makefile,v 1.5 1995/08/04 07:40:31 thorpej Exp $ -# @(#)Makefile 7.3 (Berkeley) 6/9/91 - -# Makefile for hp300 tags file and boot blocks - -S=${.CURDIR}/../.. -.include "$S/kern/Make.tags.inc" - -NOPROG= noprog -NOMAN= noman - -SUBDIR= stand ../m68k - -THP300= $S/arch/hp300/tags -SHP300= $S/arch/m68k/m68k/*.c $S/arch/m68k/include/*.h \ - $S/arch/hp300/hp300/*.[ch] $S/arch/hp300/include/*.h \ - $S/arch/hp300/dev/*.[ch] -AHP300= $S/arch/m68k/m68k/*.[Ss] $S/arch/hp300/hp300/*.[Ss] \ - $S/lib/libkern/arch/m68k/*.[sS] - -# Directories in which to place hp300 tags links -DHP300= conf dev hp300 include - -tags: - -ctags -wdtf ${THP300} ${COMM} ${SHP300} - egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${AHP300} | \ - sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \ - >> ${THP300} - sort -o ${THP300} ${THP300} +# $OpenBSD: Makefile,v 1.9 2010/05/31 22:21:43 deraadt Exp $ + +S= ${.CURDIR}/../.. +KFILE= GENERIC +.if exists(conf/GENERIC.MP) +KFILE= GENERIC.MP +.endif +TDIRS= ${_arch} include pci isa eisa +TAGS= ${.CURDIR}/tags + +NOPROG= +NOMAN= +SUBDIR= stand + +# config the fattest kernel we can find into a temporary dir +# to create a Makefile. Then use make to pull some variables +# out and push them into the sub-shell to expand the paths, +# and finally run ctags. +tags:: + TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \ + eval "S=${S}" && \ + config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \ + eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \ + eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \ + eval "_machdir=\$S/arch/$${_mach}" && \ + eval "_archdir=\$S/arch/$${_arch}" && \ + eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \ + eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \ + eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \ + ctags -wdt -f ${TAGS} $${CFILES} && \ + egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \ + sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3 \\1 /^\\2(\\3\\4$$/;" \ + >> ${TAGS} && \ + sort -o ${TAGS} ${TAGS} && \ + rm -rf $${TDIR} links: - -for i in ${DHP300}; do \ - (cd $$i && rm -f tags; ln -s ${THP300} tags); done + -for i in conf ${TDIRS}; do \ + (cd $$i && rm -f tags; ln -s tags tags); done -obj: _SUBDIRUSE +obj: _SUBDIRUSE .include <bsd.prog.mk> |