-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·40 lines (31 loc) · 1 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
CC = g++
YACC = yacc
LEX = lex
CFLAGS = -g -Wall -std=c++11
DFLAGS = -DDEBUG
YACCFLAGS = -dv
LECFLAGS = -l
INCDIR = ./include
INCDIR_EXT = ./ext
SRCDIR = src
SRCDIR_EXT = ext
GENDIR = generated
LIBS = -ll -ly
SRC = util.cpp tinyxml2.cpp bool_property.cpp node.cpp ast.cpp code_generator.cpp y.tab.cpp lex.yy.cpp stl_comp.cpp
OBJ = util.o tinyxml2.o bool_property.o node.o ast.o code_generator.o y.tab.o lex.yy.o stl_comp.o
TARGET = stl_comp
all: $(TARGET) $(OBJ)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) $(DFLAGS) -o $@ $(OBJ) $(LIBS)
y.tab.cpp: $(INCDIR)/stl_parser.y
$(YACC) $(YACCFLAGS) -o y.tab.cpp $(INCDIR)/stl_parser.y
lex.yy.cpp: $(INCDIR)/stl_parser.l
$(LEX) $(LECFLAGS) -o lex.yy.cpp $(INCDIR)/stl_parser.l
%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) $(DFLAGS) -I$(INCDIR) -I$(INCDIR_EXT) -c $<
%.o: $(SRCDIR_EXT)/%.cpp
$(CC) $(CFLAGS) $(DFLAGS) -I$(INCDIR_EXT) -c $<
%.o: %.cpp
$(CC) $(CFLAGS) $(DFLAGS) -I$(INCDIR) -c $<
clean:
rm -f y.tab.* lex.yy.* y.output plot.dot $(GENDIR)/generated_stl.h $(OBJ) $(TARGET)