summaryrefslogtreecommitdiff
path: root/sys/arch/beagle/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/beagle/Makefile')
-rw-r--r--sys/arch/beagle/Makefile69
1 files changed, 37 insertions, 32 deletions
diff --git a/sys/arch/beagle/Makefile b/sys/arch/beagle/Makefile
index 31ca4118a6d..aa3504e3aec 100644
--- a/sys/arch/beagle/Makefile
+++ b/sys/arch/beagle/Makefile
@@ -1,37 +1,42 @@
-# $OpenBSD: Makefile,v 1.1 2010/02/13 18:23:42 drahn Exp $
-# $NetBSD: Makefile,v 1.1 2001/06/12 08:32:46 chris Exp $
-
-# Makefile for beagle tags file and boot blocks
-
-S=${.CURDIR}/../..
-.include "$S/kern/Make.tags.inc"
-
-#SUBDIR= stand
-
-NOPROG= noprog
-NOMAN= noman
-
-TBEAGLE= $S/arch/beagle/tags
-
-SBEAGLE= $S/arch/beagle/dev/*.[ch] $S/arch/beagle/include/*.h \
- $S/arch/beagle/beagle/*.[ch] $S/arch/arm/arm/*.[ch] \
- $S/arch/arm/include/*.h $S/arch/arm/mainbus/*.[ch]
-ABEAGLE= $S/arch/beagle/beagle/*.S $S/arch/arm/arm/*.S \
- $S/arch/arm/mainbus/*.S
-
-# Directories in which to place tags links
-DBEAGLE= dev include beagle
-
-tags:
- -ctags -wdtf ${TBEAGLE} ${SBEAGLE} ${COMM}
- egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${ABEAGLE} | \
- sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
- >> ${TBEAGLE}
- sort -o ${TBEAGLE} ${TBEAGLE}
+# $OpenBSD: Makefile,v 1.2 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 ${DBEAGLE}; do \
- (cd $$i && { rm -f tags; ln -s ${TBEAGLE} tags; }) done
+ -for i in conf ${TDIRS}; do \
+ (cd $$i && rm -f tags; ln -s tags tags); done
obj: _SUBDIRUSE