From: Ulya Trofimovich Date: Mon, 20 Jul 2015 13:39:54 +0000 (+0100) Subject: Makefile.am: use inference rule '.re.cc' to avoid rule duplication. X-Git-Tag: 0.15~194 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4e1f6b1de67f2e0534353434f67e2d4ceaeeb5c;p=re2c Makefile.am: use inference rule '.re.cc' to avoid rule duplication. Inference rules is a standard POSIX make feature. --- diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 9df554af..dbcc308f 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -114,10 +114,10 @@ re2c_SOURCES = \ $(SRC) # autogenerated sources -AUTOGEN_SCANNER = scanner_lex.cc -AUTOGEN_PARSEOPT = parse_opts.cc -AUTOGEN_PARSER = parser.cc -AUTOGEN_PARSER_HDR = y.tab.h +AUTOGEN_SCANNER = src/parse/scanner_lex.cc +AUTOGEN_PARSEOPT = src/conf/parse_opts.cc +AUTOGEN_PARSER = src/parse/parser.cc +AUTOGEN_PARSER_HDR = src/parse/y.tab.h AUTOGEN = \ $(AUTOGEN_PARSER) \ $(AUTOGEN_PARSER_HDR) \ @@ -126,12 +126,12 @@ AUTOGEN = \ nodist_re2c_SOURCES = $(AUTOGEN) # bootstrap sources -BOOTSTRAP_SCANNER = bootstrap/scanner_lex.cc -BOOTSTRAP_PARSEOPT = bootstrap/parse_opts.cc -BOOTSTRAP_PARSER = bootstrap/parser.cc -BOOTSTRAP_PARSER_HDR = bootstrap/y.tab.h -BOOTSTRAP_DOC_MAN = bootstrap/re2c.1 -BOOTSTRAP_DOC_HTML = bootstrap/manual.html +BOOTSTRAP_SCANNER = bootstrap/src/parse/scanner_lex.cc +BOOTSTRAP_PARSEOPT = bootstrap/src/conf/parse_opts.cc +BOOTSTRAP_PARSER = bootstrap/src/parse/parser.cc +BOOTSTRAP_PARSER_HDR = bootstrap/src/parse/y.tab.h +BOOTSTRAP_DOC_MAN = bootstrap/doc/re2c.1 +BOOTSTRAP_DOC_HTML = bootstrap/doc/manual.html BOOTSTRAP = \ $(BOOTSTRAP_DOC_HTML) \ $(BOOTSTRAP_DOC_MAN) \ @@ -194,27 +194,16 @@ $(AUTOGEN_PARSER): $(CUSTOM_PARSER) # rule has side effects: # - bootstrap file in source directory, must manually prepend $(top_srcdir) -$(AUTOGEN_SCANNER): $(CUSTOM_SCANNER) +.re.cc: @if test -x $(RE2C); \ then \ $(RE2C) $(RE2CFLAGS) -o $@ $< && \ - cp $@ $(top_srcdir)/$(BOOTSTRAP_SCANNER); \ + cp $@ $(top_srcdir)/bootstrap/$@; \ else \ - cp $(top_srcdir)/$(BOOTSTRAP_SCANNER) $@; \ + cp $(top_srcdir)/bootstrap/$@ $@; \ fi -# rule has side effects: -# - bootstrap file in source directory, must manually prepend $(top_srcdir) -$(AUTOGEN_PARSEOPT): $(CUSTOM_PARSEOPT) - @if test -x $(RE2C); \ - then \ - $(RE2C) $(RE2CFLAGS) -o $@ $< && \ - cp $@ $(top_srcdir)/$(BOOTSTRAP_PARSEOPT); \ - else \ - cp $(top_srcdir)/$(BOOTSTRAP_PARSEOPT) $@; \ - fi - -# rebuild lexer (just in case it was bootstrapped) and rebuild re2c +# rebuild all re2c sources using newly built re2c .PHONY: bootstrap bootstrap: all rm $(AUTOGEN_SCANNER) $(AUTOGEN_PARSEOPT) diff --git a/re2c/bootstrap/manual.html b/re2c/bootstrap/doc/manual.html similarity index 96% rename from re2c/bootstrap/manual.html rename to re2c/bootstrap/doc/manual.html index d5bcb12b..a0ed2380 100644 --- a/re2c/bootstrap/manual.html +++ b/re2c/bootstrap/doc/manual.html @@ -2309,14 +2309,14 @@ Ulya Trofimovich skvadrik@gmail.com

VERSION INFORMATION

-

This manpage describes re2c, version 0.14.1.dev, package date 16 Jun 2015.

+

This manpage describes re2c, version 0.14.1.dev, package date 20 Jul 2015.


diff --git a/re2c/bootstrap/re2c.1 b/re2c/bootstrap/doc/re2c.1 similarity index 99% rename from re2c/bootstrap/re2c.1 rename to re2c/bootstrap/doc/re2c.1 index 4ecdc5fc..952bc29b 100644 --- a/re2c/bootstrap/re2c.1 +++ b/re2c/bootstrap/doc/re2c.1 @@ -2,12 +2,12 @@ .\" Title: re2c .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.0 -.\" Date: 06/16/2015 +.\" Date: 07/20/2015 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "RE2C" "1" "06/16/2015" "\ \&" "\ \&" +.TH "RE2C" "1" "07/20/2015" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1539,4 +1539,4 @@ skvadrik@gmail\&.com .RE .SH "VERSION INFORMATION" .sp -This manpage describes \fBre2c\fR, version 0\&.14\&.1\&.dev, package date 16 Jun 2015\&. +This manpage describes \fBre2c\fR, version 0\&.14\&.1\&.dev, package date 20 Jul 2015\&. diff --git a/re2c/bootstrap/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc similarity index 100% rename from re2c/bootstrap/parse_opts.cc rename to re2c/bootstrap/src/conf/parse_opts.cc diff --git a/re2c/bootstrap/parser.cc b/re2c/bootstrap/src/parse/parser.cc similarity index 100% rename from re2c/bootstrap/parser.cc rename to re2c/bootstrap/src/parse/parser.cc diff --git a/re2c/bootstrap/scanner_lex.cc b/re2c/bootstrap/src/parse/scanner_lex.cc similarity index 99% rename from re2c/bootstrap/scanner_lex.cc rename to re2c/bootstrap/src/parse/scanner_lex.cc index 48160f72..f771f7cb 100644 --- a/re2c/bootstrap/scanner_lex.cc +++ b/re2c/bootstrap/src/parse/scanner_lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.2 on Wed Jun 10 17:27:57 2015 */ +/* Generated by re2c 0.14.3 on Sun Jul 19 18:08:49 2015 */ #include #include #include diff --git a/re2c/bootstrap/y.tab.h b/re2c/bootstrap/src/parse/y.tab.h similarity index 100% rename from re2c/bootstrap/y.tab.h rename to re2c/bootstrap/src/parse/y.tab.h