-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (31 loc) · 874 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
CC ?= clang
CXX ?= clang++
EXE = sdll
DEBUG = -g -Wall
CSTD = -std=c99
CXXSTD = -std=c++11
CFLAGS = -Wno-deprecated-register -O0 $(DEBUG) $(CSTD)
CXXFLAGS = -O0 $(DEBUG) $(CXXSTD)
CPPOBJ = main src/dl_driver src/Ontology
SOBJ = parser lexer
FILES = $(addsuffix .cpp, $(CPPOBJ))
OBJS = $(addsuffix .o, $(CPPOBJ))
CLEANLIST = $(addsuffix .o, $(OBJ)) $(OBJS) \
parser.tab.cc parser.tab.hh \
location.hh position.hh \
stack.hh parser.output parser.o \
lexer.o lexer.yy.cc $(EXE)\
.PHONY: all
all:$(FILES)
$(MAKE) $(SOBJ)
$(MAKE) $(OBJS)
$(CXX) $(CXXFLAGS) -o $(EXE) $(OBJS) parser.o lexer.o
parser: build/parser.yy
bison -d -v build/parser.yy
$(CXX) $(CXXFLAGS) -c -o parser.o parser.tab.cc
lexer: build/lexer.l
flex --outfile=lexer.yy.cc $<
$(CXX) $(CXXFLAGS) -c lexer.yy.cc -o lexer.o
.PHONY: clean
clean:
rm -rf $(CLEANLIST)