-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (28 loc) · 849 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
44
45
.PHONY: all clean remake
all: y++ ypp_all_source
clean:
rm -f *.o *.dSYM y++ bin/*
remake: clean all
main.o: main.cpp
g++ -c main.cpp -Wall -std=c++11
translate.o: translate.cpp
g++ -c translate.cpp -Wall -std=c++11
tokenize.o: tokenize.cc
g++ -c tokenize.cc -Wall -std=c++11
compile.o: compile.cc
g++ -c compile.cc -Wall -std=c++11
postfix.o: postfix.cc
g++ -c postfix.cc -Wall -std=c++11
ast.o: ast.cc
g++ -c ast.cc -Wall -std=c++11
y++: main.o translate.o ast.o tokenize.o compile.o postfix.o y_lib.o
g++ -o y++ tokenize.o compile.o postfix.o translate.o ast.o main.o
y_lib.o: y_lib.cc
g++ -c y_lib.cc -o y_lib.o -Wall -std=c++11
YPP_FILES := $(wildcard ypp/*.ypp)
OUT_FILES := $(addprefix bin/,$(notdir $(YPP_FILES:.ypp=)))
bin/%: ypp/%.ypp y++
./y++ $< $@
bin:
mkdir bin
ypp_all_source: y++ y_lib.h bin $(OUT_FILES)