summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2017-01-03 20:42:49 +0800
committerWill Estes <westes575@gmail.com>2017-01-24 11:56:09 -0500
commite8cb34ed48f2b0e52b65e78360f9012db664be2f (patch)
treeaba61cf8d6cb7fb79b9e67fd430f2b1d4356512e /tests
parentafc687f586d06b00379c3d0ce31244fe893456ed (diff)
test: Remake *_scanner.c if *_scanner.h is missing.
If a ${foo}_scanner.c exists but the respective ${foo}_scanner.h is missing, then 'make' can halt. Fix this by deleting the ${foo}_scanner.c file and then remake it. This rule is the same as the automake-generated rule for .c files that require LEX or YACC (except automake will use ylwrap).
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 637e50d..ea170ae 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -339,15 +339,24 @@ FLEX = $(top_builddir)/src/flex
bison_nr_main.$(OBJEXT): bison_nr_parser.h bison_nr_scanner.h
bison_nr_scanner.$(OBJEXT): bison_nr_parser.h
+
bison_nr_scanner.h: bison_nr_scanner.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
bison_yylloc_main.$(OBJEXT): bison_yylloc_parser.h bison_yylloc_scanner.h
bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h
+
bison_yylloc_scanner.h: bison_yylloc_scanner.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
bison_yylval_main.$(OBJEXT): bison_yylval_parser.h bison_yylval_scanner.h
bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h
+
bison_yylval_scanner.h: bison_yylval_scanner.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
# automake does not support compiling flex scanners output in C as C++
# so we explicitly sayhow, using the .lll suffix for the lex input file
@@ -356,18 +365,36 @@ bison_yylval_scanner.h: bison_yylval_scanner.c
$(FLEX) -o $@ $<
header_nr_main.$(OBJEXT): header_nr_scanner.h
+
header_nr_scanner.h: header_nr_scanner.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
header_r_main.$(OBJEXT): header_r_scanner.h
+
header_r_scanner.h: header_r_scanner.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_nr_main.$(OBJEXT): multiple_scanners_nr_1.h multiple_scanners_nr_2.h
+
multiple_scanners_nr_1.h: multiple_scanners_nr_1.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
+
multiple_scanners_nr_2.h: multiple_scanners_nr_2.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
multiple_scanners_r_main.$(OBJEXT): multiple_scanners_r_1.h multiple_scanners_r_2.h
+
multiple_scanners_r_1.h: multiple_scanners_r_1.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
+
multiple_scanners_r_2.h: multiple_scanners_r_2.c
+ @if test ! -f $@; then rm -f $<; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) $<; else :; fi
posixly_correct.c: posixly_correct.l $(FLEX)
POSIXLY_CORRECT=1 $(FLEX) -o $@ $<