-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (33 loc) · 1.04 KB
/
Makefile
File metadata and controls
42 lines (33 loc) · 1.04 KB
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
CXX := g++
LEX := flex
YACC := bison
CFLAGS := -MMD
EFILE := ui
OBJS := base/base.o base/color.o base/error.o base/manager.o base/timer.o \
buffer/buffer.o catalog/catalog.o command/command.o index/index.o \
interpreter/interpreter.o interpreter/parser.o interpreter/scanner.o $(EFILE).o
DEPS := $(OBJS:.o=.d)
.SUFFIXES:
.SUFFIXES: .cpp
debug: OPT := -g
debug: $(EFILE)
release: OPT := -O2
release: $(EFILE)
$(OBJS): interpreter/interpreter_prepare
$(EFILE): $(OBJS)
g++ $(CFLAGS) $(OPT) -o $@ $^
-include $(DEPS)
interpreter/parser.cpp interpreter/scanner.cpp: interpreter/interpreter_prepare
interpreter/interpreter_prepare: interpreter/parser.y interpreter/scanner.l
$(LEX) -o $(<D)/scanner.cpp $(<D)/scanner.l
$(YACC) -o $(<D)/parser.cpp $(<D)/parser.y
touch interpreter/interpreter_prepare
%.o: %.cpp
$(CXX) $(CFLAGS) $(OPT) -c -o $@ $<
clean:
rm -rf $(OBJS)
rm -rf $(DEPS)
rm -rf $(EFILE)
rm -rf interpreter/scanner.cpp interpreter/parser.cpp \
interpreter/parser.hpp interpreter/*.hh \
interpreter/interpreter_prepare