forked from thomasluce/YAPWTP
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
46 lines (39 loc) · 1.38 KB
/
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
44
45
46
EXAMPLES = syntax
OS=$(shell uname)
CFLAGS = -fPIC -O3 -g3 -Wall -std=gnu99
all : $(EXAMPLES)
syntax : .FORCE
mkdir -p bin
leg -o src/syntax.leg.c src/syntax.leg
$(CC) $(CFLAGS) -c src/bstrlib.c
$(CC) $(CFLAGS) -c src/syntax.leg.c
$(CC) $(CFLAGS) -c src/list.c
$(CC) $(CFLAGS) -c src/content.c
$(CC) $(CFLAGS) -c src/io.c
$(CC) $(CFLAGS) -c src/parse.c
$(CC) $(CFLAGS) -c src/stack.c
ifeq ($(OS), Darwin)
$(CC) $(CFLAGS) -dynamiclib -shared -o libkiwi.so syntax.leg.o bstrlib.o list.o stack.o content.o io.o parse.o
else
$(CC) $(CFLAGS) -shared -o libkiwi.so syntax.leg.o bstrlib.o list.o stack.o content.o io.o parse.o
endif
$(CC) $(CFLAGS) -c src/main.c
$(CC) $(CFLAGS) -o bin/parser main.o syntax.leg.o bstrlib.o list.o stack.o content.o io.o parse.o
testlist: .FORCE
$(CC) $(CFLAGS) -c src/bstrlib.c
$(CC) $(CFLAGS) -c src/list.c
$(CC) $(CFLAGS) -c src/testlist.c
$(CC) $(CFLAGS) -o bin/testlist testlist.o bstrlib.o list.o
memtest: .FORCE
$(CC) $(CFLAGS) -c src/bstrlib.c
$(CC) $(CFLAGS) -c src/syntax.leg.c
$(CC) $(CFLAGS) -c src/list.c
$(CC) $(CFLAGS) -c src/content.c
$(CC) $(CFLAGS) -c src/io.c
$(CC) $(CFLAGS) -c src/parse.c
$(CC) $(CFLAGS) -c src/memtest.c
$(CC) $(CFLAGS) -c src/stack.c
$(CC) $(CFLAGS) -o bin/memtest memtest.o syntax.leg.o bstrlib.o list.o stack.o content.o io.o parse.o
clean : .FORCE
rm -rf bin/* *~ *.o *.[pl]eg.[cd] *.so *.a $(EXAMPLES)
.FORCE :