summaryrefslogtreecommitdiff
path: root/sys/arch/zaurus
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/zaurus')
-rw-r--r--sys/arch/zaurus/Makefile66
1 files changed, 35 insertions, 31 deletions
diff --git a/sys/arch/zaurus/Makefile b/sys/arch/zaurus/Makefile
index 466a1bfe5e6..798edf4d95f 100644
--- a/sys/arch/zaurus/Makefile
+++ b/sys/arch/zaurus/Makefile
@@ -1,38 +1,42 @@
-# $OpenBSD: Makefile,v 1.3 2005/05/06 02:20:24 uwe Exp $
-# $NetBSD: Makefile,v 1.1 2001/06/12 08:32:46 chris Exp $
-
-# Makefile for zaurus tags file and boot blocks
-
-S=${.CURDIR}/../..
-.include "$S/kern/Make.tags.inc"
-
+# $OpenBSD: Makefile,v 1.4 2010/05/31 22:21:44 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
-NOPROG= noprog
-NOMAN= noman
-
-TZAURUS= $S/arch/zaurus/tags
-
-SZAURUS= $S/arch/zaurus/dev/*.[ch] $S/arch/zaurus/include/*.h \
- $S/arch/zaurus/zaurus/*.[ch] $S/arch/arm/arm/*.[ch] \
- $S/arch/arm/include/*.h $S/arch/arm/mainbus/*.[ch] \
- $S/arch/arm/sa11x0/*.[ch] $S/arch/arm/xscale/*.[ch]
-AZAURUS= $S/arch/zaurus/zaurus/*.S $S/arch/arm/arm/*.S \
- $S/arch/arm/mainbus/*.S $S/arch/arm/xscale/*.S
-
-# Directories in which to place tags links
-DZAURUS= dev include zaurus
-
-tags:
- -ctags -wdtf ${TZAURUS} ${SZAURUS} ${COMM}
- egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${AZAURUS} | \
- sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
- >> ${TZAURUS}
- sort -o ${TZAURUS} ${TZAURUS}
+# 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 ${DZAURUS}; do \
- (cd $$i && { rm -f tags; ln -s ${TZAURUS} tags; }) done
+ -for i in conf ${TDIRS}; do \
+ (cd $$i && rm -f tags; ln -s tags tags); done
obj: _SUBDIRUSE