-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 826 Bytes
/
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
# all: latteM runtime compiler rights
all: compiler
bnfc: bnfc_download bnfc_install
bnfc_download:
wget https://github.com/mlazowik/bnfc/archive/176-source-position.zip
unzip 176-source-position.zip
rm 176-source-position.zip
cd bnfc-176-source-position/source && cabal install
bnfc_install:
cd bnfc-176-source-position/source && cabal install
bnfc_binary = ../bnfc-176-source-position/source/dist/build/bnfc/bnfc
latteM:
cp src/Latte.cf latte/Latte.cf
cd latte && $(bnfc_binary) --functor -m Latte.cf
$(MAKE) -C latte
runtime:
gcc -m32 -S -o build/runtime.s src/runtime.c
gcc -m32 -o lib/runtime.o -c build/runtime.s
rm build/runtime.s
compiler:
ghc src/Main.hs -o build/Compiler -odir build -isrc -ilatte
mv src/*.hi build
rights:
chmod +x latc_x86
clean:
rm -f latte/*
rm -f build/*
.PHONY: all