]> granicus.if.org Git - re2c/commit
Makefile.am: update bootstrap parser when necessary.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 24 Aug 2015 13:38:16 +0000 (14:38 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 24 Aug 2015 13:44:18 +0000 (14:44 +0100)
commitf4c0ad80a6b5395ba48ea37cc2c181411179a91d
tree6866cf81e46761e409b514edb1861073a17eb2d9
parentfa7659cb67073d86b572bd58cca92d80e01bb371
Makefile.am: update bootstrap parser when necessary.

The mechanism of updating bootstrap parser was broken by commit
b2bc24704ebd2a0e6050f755dbd93a5cd987a418 : "Support 'make distcheck'."

Before that commit bootstrap parser was updated every time when autogenerated
parser was updated. This approach contradicted with 'make distcheck' which
mounts top source directory read-only (including bootstrap files). That commit
tried to solve the problem by checking if the autogenerated parser has changed
and only then copying it to bootstrap parser.

I made two mistakes:
    - philisophic mistake: autogenerated parser was actually altered by
      'make distcheck' because of altered paths in '#line' info;
    - shell scripting mistake: the check if the autogenerated parser has
      changed was inverted, so bootstrap parser was never updated;

This commit makes use of two observations:
    - bootstrap parser depends on the source parser, not on the autogenerated
      parser;
    - bootstrap parser shouldn't at all contain line information: at the time
      it is copied to build directory the relative path from build directory
      to source directory may be completely different (as it is with 'make
      distcheck');
re2c/Makefile.am
re2c/bootstrap/src/parse/parser.cc
re2c/bootstrap/src/parse/y.tab.h