#!/usr/bin/env bash
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
# Build TAGS file for emacs using Exuberant ctags.

if ( type -pf exctags >/dev/null ) then
    CTAGS=exctags  # FreeBSD
else
    CTAGS=ctags
fi

echo "Building source code tags.  Run visit-tags-table in emacs."

SRC_FILES="${SRC_FILES} `find src -name "*.cc" -or -name "*.hh" -or -name "*.lua"`"

if [ -d scripts ]; then
    SRC_FILES="${SRC_FILES} `find scripts -name "*.lua"`"
fi

$CTAGS -e --extra=+q $SRC_FILES
