forked from matz/streem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (30 loc) · 757 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
YACC = bison -y
LEX = flex
TARGET = bin/streem
CFLAGS = -g -Wall
LIBS =
ifeq (Windows_NT,$(OS))
TARGET:=$(TARGET).exe
endif
TESTS=$(wildcard examples/*.strm)
all : $(TARGET)
.PHONY : all
test : all
$(TARGET) $(TESTS)
.PHONY : test
src/y.tab.c : src/parse.y
$(YACC) -o src/y.tab.c src/parse.y
src/lex.yy.c : src/lex.l
$(LEX) -osrc/lex.yy.c src/lex.l
src/parse.o : src/y.tab.c src/lex.yy.c
$(CC) -g -c src/y.tab.c -o src/parse.o
src/main.o : src/main.c
$(CC) -g -c src/main.c -o src/main.o
$(TARGET) : src/parse.o src/node.o src/main.o
mkdir -p "$$(dirname $(TARGET))"
$(CC) $(CFLAGS) src/parse.o src/node.o src/main.o -o $(TARGET) $(LIBS)
clean :
rm -f src/y.output src/y.tab.c
rm -f src/lex.yy.c
rm -f src/*.o $(TARGET)
.PHONY : clean