options: rename --defines as --header

The name "defines" is incorrect, the generated file contains far more
than just #defines.

* src/getargs.h, src/getargs.c (-H, --header): New option.
With optional argument, just like --defines, --xml, etc.
(defines_flag): Rename as...
(header_flag): this.
Adjust dependencies.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.c,
* data/skeletons/glr.cc, data/skeletons/glr2.cc, data/skeletons/lalr1.cc,
* data/skeletons/yacc.c:
Adjust.
* examples, doc/bison.texi: Adjust.
* tests/headers.at, tests/local.at, tests/output.at: Convert most
tests from using --defines to using --header.
This commit is contained in:
Akim Demaille
2020-09-06 13:30:23 +02:00
parent b329f0b5df
commit 75c3746ce2
27 changed files with 78 additions and 63 deletions

View File

@@ -19,7 +19,7 @@ LIBS = -lreadline -lm # In some environments, -lintl is needed.
all: $(BASE)
%.c %.h %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
$(BISON) $(BISONFLAGS) --header --xml --graph=$*.gv -o $*.c $<
$(BASE): parse.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)

View File

@@ -8,7 +8,7 @@ XSLTPROC = xsltproc
all: $(BASE)
%.c %.h %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
$(BISON) $(BISONFLAGS) --header --xml --graph=$*.gv -o $*.c $<
$(BASE): $(BASE).o
$(CC) $(CFLAGS) -o $@ $^

View File

@@ -9,7 +9,7 @@ XSLTPROC = xsltproc
all: $(BASE)
%.c %.h %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
$(BISON) $(BISONFLAGS) --header --xml --graph=$*.gv -o $*.c $<
%.c: %.l
$(FLEX) $(FLEXFLAGS) -o$@ $<

View File

@@ -8,7 +8,7 @@ XSLTPROC = xsltproc
all: $(BASE)
%.c %.h %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
$(BISON) $(BISONFLAGS) --header --xml --graph=$*.gv -o $*.c $<
$(BASE): $(BASE).o
$(CC) $(CFLAGS) -o $@ $^

View File

@@ -9,7 +9,7 @@ XSLTPROC = xsltproc
all: $(BASE)
%.c %.h %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
$(BISON) $(BISONFLAGS) --header --xml --graph=$*.gv -o $*.c $<
%.c %.h: %.l
$(FLEX) $(FLEXFLAGS) -o$*.c --header=$*.h $<