1CCFLAGS = -ansi -Wall -Wshadow -O2
2LFLAGS = -lm
3
4.PHONY = all clean
5
6all: test test_pr bench example example2 example3
7
8
9test: test.c tinyexpr.c
10	$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
11	./$@
12
13test_pr: test.c tinyexpr.c
14	$(CC) $(CCFLAGS) -DTE_POW_FROM_RIGHT -DTE_NAT_LOG -o $@ $^ $(LFLAGS)
15	./$@
16
17bench: benchmark.o tinyexpr.o
18	$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
19
20example: example.o tinyexpr.o
21	$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
22
23example2: example2.o tinyexpr.o
24	$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
25
26example3: example3.o tinyexpr.o
27	$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
28
29.c.o:
30	$(CC) -c $(CCFLAGS) $< -o $@
31
32clean:
33	rm -f *.o *.exe example example2 example3 bench test_pr test
34