%_tags.h: %_tags mktagheaders
$(AM_V_at)chmod +x @srcdir@/mktagheaders
- $(AM_V_GEN)( @srcdir@/mktagheaders "$<" ) >"$@"
+ $(AM_V_GEN)( @srcdir@/mktagheaders "$<" "$<" ) >"$@"
# This .tmp business is to keep from having to re-compile options.cpp
# (and then re-link the libraries) if nothing has changed.
# expression (no |, no \<, ...).
Debug_tags.tmp Trace_tags.tmp: mktags
$(AM_V_at)chmod +x @srcdir@/mktags
- $(AM_V_GEN)(@srcdir@/mktags '$(@:_tags.tmp=)' '@srcdir@/../') >"$@"
+ $(AM_V_GEN)(@srcdir@/mktags \
+ '$(@:_tags.tmp=)' \
+ "$$(find @srcdir@/../ -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.g')") >"$@"
MOSTLYCLEANFILES = \
Debug_tags \
#
# Invocation:
#
-# mktagheaders <tag-file>
+# mktagheaders <tag-name> <tag-file>
#
+# <tag-name> will be the name of the generated array.
+# <tag-file> each line of this file is turned into a string in the generated
+# array.
-TAG_FILE=$1
+TAG_NAME=$1
+TAG_FILE=$2
-echo 'static char const* const '$TAG_FILE'[] = {';
+echo 'static char const* const '$TAG_NAME'[] = {';
for tag in `cat $TAG_FILE`; do
echo "\"$tag\",";
done;
#
# Invocation:
#
-# mktags {Debug,Trace} <directory>
+# mktags {Debug,Trace} <input-files>
#
+# <input-files> is expected to be passed a single space separated list of files.
+# One can use quotes to achieve this. This is one reason to use "$(...)"
+# instead of back ticks `...`.
DebugOrTrace=$1
-FindDirectory=$2
+InputFiles=$2
grep -h '\<'$DebugOrTrace'\(\.isOn\)* *( *\".*\" *)' \
- `find $FindDirectory -name "*.cpp" -o -name "*.h" -o -name "*.cc" -o -name "*.g"` | \
+ $InputFiles | \
sed 's/\/\/.*//;s/^'$DebugOrTrace'\(\.isOn\)* *( *\"\([^"]*\)\".*/\2/;s/.*[^a-zA-Z0-9_]'$DebugOrTrace'\(\.isOn\)* *( *\"\([^"]*\)\".*/\2/' | \
LC_ALL=C sort | \
uniq