Skip to content

Commit

Permalink
examples: rely on ylwrap
Browse files Browse the repository at this point in the history
Reported by Thomas Petazzoni.
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00000.html

* examples/c/reccalc/scan.l: Generate scan.h.
* examples/c/reccalc/local.mk: Remove dedicated rules, leave the
handling of multiple outputs to Automake's ylwrap.
  • Loading branch information
akimd committed Aug 3, 2019
1 parent 2d00f46 commit c9dd23a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Sum Wu sum@geekhouse.org
Théophile Ranquet theophile.ranquet@gmail.com
Thiru Ramakrishnan thiru.ramakrishnan@gmail.com
Thomas Jahns jahns@dkrz.de
Thomas Petazzoni thomas.petazzoni@bootlin.com
Tim Josling tej@melbpc.org.au
Tim Landscheidt tim@tim-landscheidt.de
Tim Van Holder tim.van.holder@pandora.be
Expand Down
12 changes: 0 additions & 12 deletions examples/c/reccalc/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ endif FLEX_WORKS
DASH = -
%D%/reccalc$(DASH)parse.o: %D%/scan.h

%D%/scan.c %D%/scan.h: %D%/scan.stamp
@test -f $@ || rm -f %D%/scan.stamp
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/scan.stamp

%D%/scan.stamp: %D%/scan.l
$(AM_V_LEX)rm -f $@ $@.tmp
$(AM_V_at)$(MKDIR_P) %D%
$(AM_V_at)touch $@.tmp
$(AM_V_at)$(LEX) -o%D%/scan.c --header-file=%D%/scan.h $(srcdir)/%D%/scan.l
$(AM_V_at)mv $@.tmp $@


EXTRA_DIST += %D%/reccalc.test %D%/scan.l
dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
CLEANFILES += %D%/parse.[ch] %D%/parse.output %D%/scan.[ch] %D%/*.stamp
Expand Down
2 changes: 1 addition & 1 deletion examples/c/reccalc/scan.l
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* Disable Flex features we don't need, to avoid warnings. */
%option nodefault noinput nounput noyywrap

%option reentrant
%option reentrant header-file="scan.h"

%{
#include <assert.h>
Expand Down

0 comments on commit c9dd23a

Please sign in to comment.