-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 1.07 KB
/
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=ghc
SRC=$(wildcard src/*.hs) $(wildcard src/Llvm/*.hs)
LEX=src/ParLatte.hs src/LexLatte.hs
BINS=latc_llvm latc
RUNTIME=lib/runtime.bc
all: $(LEX) $(BINS) $(RUNTIME)
latc: latc_llvm
ln -s latc_llvm latc
latc_llvm: $(LEX) $(SRC)
$(CC) -isrc --make src/Llvm/CompilerIO.hs -o latc_llvm
src/ParLatte.y src/LexLatte.x: src/Latte.cf
cd src; /home/students/inf/PUBLIC/MRJP/bin/bnfc --functor Latte.cf
cp lib/ErrM.hs src/
src/ParLatte.hs: src/ParLatte.y
cd src; happy -gca ParLatte.y
src/LexLatte.hs: src/LexLatte.x
cd src; alex -g LexLatte.x
lib/runtime.bc: lib/runtime.ll
cd lib; llvm-as -o runtime.bc runtime.ll
test: all
./test.sh tests/official/good/
./test.sh tests/my/good/
clean:
-rm -f src/*.log src/*.aux src/*.hi src/*.o src/*.dvi
-rm -f src/**/*.log src/**/*.aux src/**/*.hi src/**/*.o src/**/*.dvi
-rm -f **/*.bc tests/*.ll
-rm -f $(LEX)
-rm -f $(BINS)
distclean: clean
cd src; rm -f DocLatte.* LexLatte.* ParLatte.* LayoutLatte.* SkelLatte.* PrintLatte.* TestLatte.* AbsLatte.* TestLatte ErrM.* SharedString.* ComposOp.* Latte.dtd XMLLatte.*
.PHONY: clean distclean