summaryrefslogtreecommitdiff
path: root/examples/c/rpcalc/Makefile
blob: 23ea410cb67f9df2d947c9a6a6700d43346cb5e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# This Makefile is designed to be simple and readable.  It does not
# aim at portability.  It requires GNU Make.

BASE = rpcalc
BISON = bison

all: $(BASE)

%.c %.html %.gv: %.y
	$(BISON) $(BISONFLAGS) --html --graph -o $*.c $<

%: %.c
	$(CC) $(CFLAGS) -o $@ $<

run: $(BASE)
	@echo "Type arithmetic expressions in Reverse Polish Notation.  Quit with ctrl-d."
	./$<

clean:
	rm -f $(BASE) $(BASE).c $(BASE).html $(BASE).xml $(BASE).gv