-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (34 loc) · 1.26 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
43
# Budowanie projektu combailera
.PHONY: build jflex cup kotlin java run test clean
# Generowanie lexera, parsera i kompilowanie źródeł.
build: kotlin java
@echo "Kompilacja projektu przebiegła pomyślnie"
# Generowanie lexera
jflex:
@echo "**************** JFlex ****************"
./jflex src/jflex/Scanner.flex -d src/java/
# Generowanie parsera
cup:
@echo "**************** CUP ****************"
./cup -destdir src/java/ -interface -locations -parser Parser src/cup/Parser.cup
# Kompilowanie plików źródłowych *.kt
kotlin: jflex cup
@echo "**************** Kotlin ****************"
kotlinc -cp "lib/java-cup-11b-runtime.jar" $$(find ./src/kotlin -name "*.kt") src/java/*.java -d bin/
# Kompilowanie wygenerowanych plików *.java
java: kotlin
@echo "**************** Java ****************"
javac -cp "lib/java-cup-11b-runtime.jar:bin/" src/java/*.java -d bin/
# Uruchomienie skompilowanych źródeł (wymaga wcześniejszego skompilowania)
run:
@echo "**************** RUN ****************"
java -cp "lib/kotlin-stdlib.jar:lib/java-cup-11b-runtime.jar:bin/" MainKt
test:
./run test.damn out.dasm
./tests/maszyna-wirtualna out.dasm
# Czyszczenie projektu
clean:
@echo "**************** CLEAN ****************"
rm -Rf bin/*
rm -Rf src/java/*
rm -Rf out/