-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·73 lines (52 loc) · 1.93 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#---------------------------------------------------------------
# CONFIGURE THESE VARIABLES IF NEEDED
#---------------------------------------------------------------
ROOT =
CDK_INC_DIR = $(ROOT)/usr/include
CDK_LIB_DIR = $(ROOT)/usr/lib
L_NAME=AtScanner
Y_NAME=AtParser
#---------------------------------------------------------------
# PROBABLY, NO NEED TO CHANGE ANYTHING BEYOND THIS POINT
#---------------------------------------------------------------
LFLAGS =
YFLAGS = -dtv
# CXXFLAGS = -Wall -O6 -s -Isemantics -I. -I$(CDK_INC_DIR) -I$(CDK_INC_DIR)/cdk
CXXFLAGS = -ansi -DYYDEBUG=1 -Wall -ggdb -Isemantics -I. -I$(CDK_INC_DIR) -I$(CDK_INC_DIR)/cdk
LDFLAGS = -L$(CDK_LIB_DIR) -lcdk
COMPILER = at
SRC_CPP = $(wildcard nodes/**/*.cpp) $(wildcard semantics/*.cpp) $(wildcard ./*.cpp)
OFILES = $(SRC_CPP:%.cpp=%.o)
#---------------------------------------------------------------
# DO NOT CHANGE AFTER THIS LINE
#---------------------------------------------------------------
all: nodes/all.h $(COMPILER)
%.tab.o:: %.tab.c
$(CXX) $(CXXFLAGS) -DYYDEBUG -c $< -o $@
%.o:: %.c
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o:: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.tab.c:: %.y
byacc -dtv -b $* $<
%.tab.h:: %.y
byacc -dtv -b $* $<
$(L_NAME).cpp: $(L_NAME).l
flex $(LFLAGS) $<
$(Y_NAME).tab.c: $(Y_NAME).y
$(Y_NAME).tab.h: $(Y_NAME).y
# this is needed to force byacc to run
$(L_NAME).o: $(L_NAME).cpp $(Y_NAME).tab.h
.PHONY: ./mknodedecls.pl
nodes/all.h: ./mknodedecls.pl
./mknodedecls.pl > nodes/all.h
$(COMPILER): $(L_NAME).o $(Y_NAME).tab.o $(OFILES)
$(CXX) -o $@ $^ $(LDFLAGS)
clean:
$(RM) *.tab.[ch] *.o $(OFILES) $(L_NAME).cpp $(Y_NAME).output $(COMPILER)
depend: nodes/all.h
$(CXX) $(CXXFLAGS) -MM $(SRC_CPP) > .makedeps
-include .makedeps
#---------------------------------------------------------------
# THE END
#---------------------------------------------------------------