package: don't ship the sources generated from the parser

Because some of our examples use

    %C%_reccalc_SOURCES = %D%/parse.y

Automake ships parse.y and parse.c, and possibly parse.h when it
"understands" that there is one.  This is not what we want: ship only
parser.y.  Yet we still want to use Automake to compile the sources
from parser.y.  The easiest seems to use

    nodist_%C%_reccalc_SOURCES = %D%/parse.y

together with

    dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md

which guarantees that parse.y is indeed shipped.

* examples/c/calc/local.mk, examples/c/lexcalc/local.mk,
* examples/c/reccalc/local.mk: Always use nodist_*SOURCES for parsers,
let the dist_*_DATA rules do their job.
This commit is contained in:
Akim Demaille
2019-04-28 09:04:54 +02:00
parent 57290d63fd
commit 0cc04eaa2a
4 changed files with 23 additions and 6 deletions

View File

@@ -22,8 +22,7 @@ reccalcdir = $(docdir)/%D%
check_PROGRAMS += %D%/reccalc
TESTS += %D%/reccalc.test
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
%C%_reccalc_SOURCES = %D%/parse.y %D%/parse.h
nodist_%C%_reccalc_SOURCES = %D%/scan.h %D%/scan.c
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
%D%/parse.c: $(dependencies)