#!/usr/bin/env bash SRC_DIR=$1 BUILD_DIR=$2 if [ ! -e "$SRC_DIR/gcc/rtl.def" ] then echo "`$SRC_DIR' is not top directory of gcc source code" exit 1 fi if [ ! -e "$BUILD_DIR/gcc/gtype-desc.h" ] then echo "`$BUILD_DIR' is not top directory of gcc build" exit 1 fi pushd "$SRC_DIR" etags -o TAGS-RTL-DEF.sub --language=none --regex='/DEF_RTL_EXPR(\([A-Z_]+\),/\1/' gcc/rtl.def INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS-RTL-DEF.sub" for d in gcc include/ libiberty/ gcc/config/arm gcc/c-family/ gcc/lto/ gcc/cp/ do pushd "$d" etags --no-members -o TAGS.sub *.[hc] INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS.sub" popd done popd pushd "$BUILD_DIR" etags --no-members -o TAGS.sub gcc/*.[hc] INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS.sub" if [ -n "$INCLUDE_ETAGS_FILES" ] then etags $INCLUDE_ETAGS_FILES fi popd