-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·36 lines (26 loc) · 821 Bytes
/
Makefile
File metadata and controls
executable file
·36 lines (26 loc) · 821 Bytes
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
OBJS = ast.o \
parser.o \
CodeGen.o \
main.o \
tokens.o \
LLVMCONFIG = llvm-config-3.6
CPPFLAGS = `$(LLVMCONFIG) --cppflags` -std=c++11 -Wall
LDFLAGS = `$(LLVMCONFIG) --ldflags` -lpthread -ldl -lz -lncurses -rdynamic
LIBS = `$(LLVMCONFIG) --libs`
BISON = /usr/local/Cellar/bison/3.0.4/bin/bison
all: run
parser.cpp: parser.y
$(BISON) -d -o $@ $^
tokens.cpp: tokens.l parser.hpp
flex -o $@ $^
%.o: %.cpp
g++ -c $(CPPFLAGS) -o $@ $<
parser.hpp: parser.cpp
run: parser.cpp parser.hpp tokens.cpp main
main: $(OBJS)
g++ -o $@ $(OBJS) $(LIBS) $(LDFLAGS)
clean:
rm -f parser.cpp parser.hpp tokens.cpp main codegen tokens.cpp *.o *.ll \
BinarySearch BinaryTree BubbleSort Factorial LinearSearch QuickSort
# docco:
# docco tokens.l parser.y main.cpp main.h ast.cpp ast.h CodeGen.cpp CodeGen.h