Files
bison/examples/c/bistromathic/Makefile
Akim Demaille 0c0cf6f5a4 examples: modernize the example Makefiles
* examples/c++/Makefile, examples/c++/calc++/Makefile,
* examples/c++/glr/Makefile, examples/c/bistromathic/Makefile,
* examples/c/calc/Makefile, examples/c/glr/Makefile,
* examples/c/lexcalc/Makefile, examples/c/mfcalc/Makefile,
* examples/c/pushcalc/Makefile, examples/c/reccalc/Makefile,
* examples/c/rpcalc/Makefile, examples/d/calc/Makefile,
* examples/d/simple/Makefile, examples/java/calc/Makefile,
* examples/java/simple/Makefile:
Use --html to generate *.html directly.
No longer demonstrate --xml.
No longer show rules for xml to html.
Use --header, not --defines.
Use --graph without specifying the output file now that we
generate *.gv by default.
2021-08-04 10:07:48 +02:00

36 lines
996 B
Makefile

# This Makefile is designed to be simple and readable. It does not
# aim at portability. It requires GNU Make.
BASE = bistromathic
BISON = bison
# We need to find the headers and libs for readline (and possibly intl).
# You probably need to customize this for your own environment.
CPPFLAGS = -I/opt/local/include
LDFLAGS = -L/opt/local/lib
# Find the translation catalog for Bison's generated messagess.
BISON_LOCALEDIR = $(shell $(BISON) $(BISON_FLAGS) --print-localedir)
CPPFLAGS += -DENABLE_NLS -DBISON_LOCALEDIR='"$(BISON_LOCALEDIR)"'
LIBS = -lreadline -lm # In some environments, -lintl is needed.
all: $(BASE)
%.c %.h %.html %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --header --html --graph -o $*.c $<
$(BASE): parse.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
run: $(BASE)
@echo "Type bistromathic expressions. Quit with ctrl-d."
./$<
CLEANFILES = \
$(BASE) *.o \
parse.[ch] parse.output parse.xml parse.html parse.gv
clean:
rm -f $(CLEANFILES)