* Now works in unconfigured src directory.
* Generates top-level TAGS file.
* Includes .pkg files.
+++ /dev/null
-\f
-runtime/TAGS,include
-\f
-microcode/TAGS,include
-\f
-edwin/TAGS,include
-\f
-compiler/TAGS,include
-\f
-6001/TAGS,include
-\f
-sf/TAGS,include
-\f
-cref/TAGS,include
-\f
-rcs/TAGS,include
-\f
-ffi/TAGS,include
-#!/bin/sh
+#!/bin/bash
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# Utility to make TAGS files for MIT/GNU Scheme build directories.
# The working directory must be the top-level source directory.
-for SUBDIR; do
+set -e
+
+DEFAULT_SUBDIRS=( \
+ 6001 \
+ blowfish \
+ compiler \
+ cref \
+ edwin \
+ ffi \
+ gdbm \
+ imail \
+ mcrypt \
+ md5 \
+ mhash \
+ microcode \
+ rcs \
+ sf \
+ sos \
+ ssp \
+ star-parser \
+ win32 \
+ xdoc \
+ xml \
+)
+
+SUBDIRS=("${@}")
+if (( ${#SUBDIRS[@]} == 0 )); then
+ SUBDIRS=("${DEFAULT_SUBDIRS[@]}")
+fi
+
+for SUBDIR in "${SUBDIRS[@]}"; do
echo "making TAGS in ${SUBDIR}"
- ( cd ${SUBDIR} && ./Tags.sh ) || exit 1
+ if [[ -x ${SUBDIR}/Tags.sh ]]; then
+ SCRIPT_LOC=.
+ else
+ SCRIPT_LOC=../etc
+ fi
+ ( cd ${SUBDIR} && ${SCRIPT_LOC}/Tags.sh ) || exit 1
done
+
+function write_entries ()
+{
+ for SUBDIR in "${SUBDIRS[@]}"; do
+ echo -e "\f"
+ echo "${SUBDIR}"/TAGS,include
+ done
+}
+write_entries > TAGS
-#!/bin/sh
+#!/bin/bash
#
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# Utility to make TAGS file for the MIT/GNU Scheme compiler directory.
# The working directory must be the compiler directory.
-etags back/*.scm base/*.scm fggen/*.scm fgopt/*.scm machine/*.scm \
- rtlbase/*.scm rtlgen/*.scm rtlopt/*.scm
+set -e
+
+if [[ -d machine ]]; then
+ MACHINES=(machine/*.scm machine/*.pkg)
+else
+ MACHINES=(machines/*/*.scm machines/*/*.pkg)
+fi
+
+etags back/*.scm base/*.scm fggen/*.scm fgopt/*.scm \
+ rtlbase/*.scm rtlgen/*.scm rtlopt/*.scm "${MACHINES[@]}"
# Utility to make TAGS file for an MIT/GNU Scheme build directory.
# The working directory must be the build directory.
-etags *.scm
+etags *.scm *.pkg
# Utility to make TAGS file for the MIT/GNU Scheme MICROCODE build
# directory. The working directory must be the build directory.
-make tags
+REGEX1='/^DEF[A-Z0-9_]*[ \t]*(\("[^"]+"\|[a-zA-Z_][a-zA-Z0-9_]*\)/'
+REGEX2='/^DEF[A-Z0-9_]*[ \t]*\(("[^"]+"|[a-zA-Z_][a-zA-Z0-9_]+)/\1/'
+
+etags -r "${REGEX1}" *.[ch] */*.[ch] \
+ || etags --regex-C="${REGEX2}" *.[ch] */*.[ch]
tags: TAGS
TAGS:
- etags -r '/^DEF[A-Z0-9_]*[ \t]*(\("[^"]+"\|[a-zA-Z_][a-zA-Z0-9_]*\)/' \
- *.[ch] */*.[ch] \
- || etags \
- --regex-C='/^DEF[A-Z0-9_]*[ \t]*\(("[^"]+"|[a-zA-Z_][a-zA-Z0-9_]+)/\1/'\
- *.[ch] */*.[ch]
+ ./Tags.sh
mostlyclean:
-rm -f $(MOSTLYCLEAN_FILES)