forked from amiremohamadi/peylang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (23 loc) · 835 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
CXX := g++
LEX := flex
YACC := bison -d
PROGRAM := peyman
INCLUDE := -Iinclude/ -Iparser/
SRC := $(wildcard peylang/object/*cc) $(wildcard peylang/*cc)
OBJ := $(SRC:%.cc=%.o) parser/parser.tab.o parser/lex.yy.o
all: $(PROGRAM)
peyman: $(OBJ)
$(CXX) $(INCLUDE) -o $(PROGRAM) $(OBJ) peyman.cc
parser/parser.tab.c: parser/parser.y
$(YACC) -o parser/parser.tab.c parser/parser.y
parser/parser.tab.o: parser/parser.tab.c
$(CXX) $(INCLUDE) -c parser/parser.tab.c -o parser/parser.tab.o
parser/lex.yy.c: parser/scanner.l parser/parser.tab.o
$(LEX) -o parser/lex.yy.c parser/scanner.l
parser/lex.yy.o: parser/lex.yy.c
$(CXX) $(INCLUDE) -c parser/lex.yy.c -o parser/lex.yy.o
%.o: %.cc
$(CXX) $(INCLUDE) -c $< -o $@
clean:
rm -f $(OBJ) $(PROGRAM) parser/parser.tab.c parser/parser.tab.h parser/lex.yy.c
.PHONY: all clean