-
Notifications
You must be signed in to change notification settings - Fork 246
/
Makefile
43 lines (29 loc) · 919 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CC = gcc
CCFLAGS = -Wall -Wshadow -O2
LFLAGS = -lm
.PHONY = all clean
all: smoke smoke_pr repl bench example example2 example3
smoke: smoke.c tinyexpr.c
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
./$@
smoke_pr: smoke.c tinyexpr.c
$(CC) $(CCFLAGS) -DTE_POW_FROM_RIGHT -DTE_NAT_LOG -o $@ $^ $(LFLAGS)
./$@
repl: repl.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
repl-readline: repl-readline.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS) -lreadline
bench: benchmark.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example: example.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example2: example2.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example3: example3.o tinyexpr.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
repl-readline.o: repl.c
$(CC) -c -DUSE_READLINE $(CCFLAGS) $< -o $@
.c.o:
$(CC) -c $(CCFLAGS) $< -o $@
clean:
rm -f *.o *.exe example example2 example3 bench repl smoke_pr smoke