mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
The option --header was introduced in version 2.5.6. The option --header-file was introduced in version 2.6.4. Reported by Bruno Haible. https://lists.gnu.org/r/bug-bison/2020-05/msg00013.html So use --header, and do bother with versions that don't support it. * m4/flex.m4: Check whether flex supports --header. * configure.ac (FLEX_WORKS, FLEX_CXX_WORKS): Set to false if it doesn't. * * examples/c/reccalc/local.mk, examples/c/reccalc/Makefile: Use --header rather than --header-file.
36 lines
758 B
Makefile
36 lines
758 B
Makefile
# This Makefile is designed to be simple and readable. It does not
|
|
# aim at portability. It requires GNU Make.
|
|
|
|
BASE = reccalc
|
|
BISON = bison
|
|
FLEX = flex
|
|
XSLTPROC = xsltproc
|
|
|
|
all: $(BASE)
|
|
|
|
%.c %.h %.xml %.gv: %.y
|
|
$(BISON) $(BISONFLAGS) --defines --xml --graph=$*.gv -o $*.c $<
|
|
|
|
%.c %.h: %.l
|
|
$(FLEX) $(FLEXFLAGS) -o$*.c --header=$*.h $<
|
|
|
|
scan.o: parse.h
|
|
parse.o: scan.h
|
|
$(BASE): parse.o scan.o
|
|
$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
run: $(BASE)
|
|
@echo "Type arithmetic expressions. Quit with ctrl-d."
|
|
./$<
|
|
|
|
html: parse.html
|
|
%.html: %.xml
|
|
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<
|
|
|
|
CLEANFILES = \
|
|
$(BASE) *.o \
|
|
parse.[ch] parse.output parse.xml parse.html parse.gv \
|
|
scan.[ch]
|
|
clean:
|
|
rm -f $(CLEANFILES)
|