From: Tim King Date: Thu, 5 Nov 2015 08:08:45 +0000 (-0800) Subject: This commit slightly generalizes the scripts for generating the _tags files. X-Git-Tag: cvc5-1.0.0~6176 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4ac720f865ce499c6f818f0cdb60dfabe913df5;p=cvc5.git This commit slightly generalizes the scripts for generating the _tags files. --- diff --git a/src/options/Makefile.am b/src/options/Makefile.am index 19aa43c98..ad0ec7914 100644 --- a/src/options/Makefile.am +++ b/src/options/Makefile.am @@ -148,7 +148,7 @@ BUILT_SOURCES += \ %_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. @@ -162,7 +162,9 @@ BUILT_SOURCES += \ # 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 \ diff --git a/src/options/mktagheaders b/src/options/mktagheaders index 5ef3b3172..af44cee8d 100755 --- a/src/options/mktagheaders +++ b/src/options/mktagheaders @@ -7,12 +7,16 @@ # # Invocation: # -# mktagheaders +# mktagheaders # +# will be the name of the generated array. +# 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; diff --git a/src/options/mktags b/src/options/mktags index 169b373b8..090e57014 100755 --- a/src/options/mktags +++ b/src/options/mktags @@ -13,14 +13,17 @@ # # Invocation: # -# mktags {Debug,Trace} +# mktags {Debug,Trace} # +# 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