-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (25 loc) · 843 Bytes
/
Makefile
File metadata and controls
37 lines (25 loc) · 843 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
37
OFILES = grammar.o scanner.o main.o parser.o ast.o sem.o codegen.o
LEX = flex
BISON = bison
CPATH=/opt/llvm/bin/
CC = $(CPATH)clang++
LD = $(CPATH)clang++
CXXFLAGS=`$(CPATH)llvm-config --cppflags` -std=c++11 -Wno-deprecated-register
LDFLAGS=`$(CPATH)llvm-config --ldflags --system-libs --libs engine` -fvisibility=internal
all: parse scan parse nightfury
scan: scanner.c
parse: grammar.c
grammar.c grammar.h: grammar.y
$(BISON) --debug -d $< -o grammar.c
scanner.c: scanner.lex grammar.h
$(LEX) --bison-bridge -o $@ $<
parse: grammar.c grammar.h
nightfury: $(OFILES)
$(LD) -g $(OFILES) $(LDFLAGS) -o $@
%.o %.d : %.C
$(CC) -g -c -x c++ $(CXXFLAGS) $< -MD
%.o %.d : %.c
$(CC) -g -c -x c++ $(CXXFLAGS) $< -MD
clean:
rm -rf *.o *~ grammar.c grammar.h scanner.c *.d nightfury
include $(addsuffix .d ,$(basename $(OFILES)))