-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (43 loc) · 1.08 KB
/
Makefile
File metadata and controls
53 lines (43 loc) · 1.08 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
43
44
45
46
47
48
49
50
51
52
53
all: cube
OBJS = build/parser.o \
build/codegen.o \
build/linker_common.o \
build/main.o \
build/tokens.o \
build/core.o \
build/nassignment.o \
build/nbinaryoperator.o \
build/nblock.o \
build/nconstdeclaration.o \
build/ndouble.o \
build/nexpressionstatement.o \
build/nfunction.o \
build/nidentifier.o \
build/ninteger.o \
build/ninternaldeclaration.o \
build/nmethodcall.o \
build/nprogram.o \
build/nreturn.o \
build/nstring.o \
build/nsuperdeclaration.o \
build/nthing.o \
build/nvariabledeclaration.o
LLVMCONFIG = llvm-config
CPPFLAGS = `$(LLVMCONFIG) --cppflags` -std=c++20 -lstdc++fs -g
LDFLAGS = `$(LLVMCONFIG) --ldflags` -lpthread -ldl -lz -lncurses
LIBS = `$(LLVMCONFIG) --system-libs --libs all` -L./build/ -L.
.PHONY: clean
clean:
$(RM) -rfv build/
build/:
mkdir -vp $@
cp -v src/* $@
build/parser.cpp: build/parser.y
bison -d -o $@ $^
build/parser.hpp: build/parser.cpp
build/tokens.cpp: build/tokens.l build/parser.hpp
flex -o $@ $^
%.o: %.cpp
g++ -c $(CPPFLAGS) -o $@ $<
cube: build/ $(COMMON) $(OBJS)
g++ -o $@ $(OBJS) $(LIBS) $(LDFLAGS) -O3