forked from MetaBorgCube/java.mstx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.63 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# paths
JAVA_FRONT_DIR = lib/java.spfx/lang.java/
JAVA_FRONT_ARCHIVE = $(JAVA_FRONT)/target/lang.java-1.1.0-SNAPSHOT.spoofax-language
SPX_VERSION = 2.5.11
SUNSHINE_URL = http://artifacts.metaborg.org/service/local/repositories/releases/content/org/metaborg/org.metaborg.sunshine2/$(SPX_VERSION)/org.metaborg.sunshine2-$(SPX_VERSION).jar
SUNSHINE_JAR = bin/org.metaborg.sunshine2-$(SPX_VERSION).jar
SPEC = src/java.mstx
TESTS ?= tests/ # directory
TESTRE ?= '*' # iname
## external commands with configuration
MAVEN_OPTS = "-Xms512m -Xmx1024m -Xss16m"
MAVEN = MAVEN_OPTS=$(MAVEN_OPTS) mvn
SUNSHINE = java -jar $(SUNSHINE_JAR)
PARSE_JAVA = $(SUNSHINE) transform -n "Explicate injections" -l lib/java.spfx/lang.java -p . -i
STATIX = statix $(SPEC)
JAVAC = javac
TEST_SOURCES = $(shell find $(TESTS) -type f -name $(TESTRE:%=%.test))
.PHONY: all test
## Default target
all: test
## Get depenencies
bin:
mkdir -p bin
# get spoofax sunshine
$(SUNSHINE_JAR): bin
$(MAVEN) dependency:copy -DoutputDirectory=bin -Dartifact=org.metaborg:org.metaborg.sunshine2:$(SPX_VERSION) -Dmdep.useBaseVersion=true
# ensure that spoofax sunshine is available
sunshine: $(SUNSHINE_JAR)
# compile the java frontend
$(JAVA_FRONT_ARCHIVE): $(JAVA_FRONT_DIR)
cd $(JAVA_FRONT_DIR) && $(MAVEN) verify
# ensure the java spoofax language frontend is compiled and available
javafront: $(JAVA_FRONT_ARCHIVE) sunshine
## Testing
tests/runner: tests/runner.hs
cd tests && ./build
test: $(TEST_SOURCES) tests/runner
@./tests/run $(TEST_SOURCES) | grep '[\[]SUCCESS\|FAILURE'
## Building
## Cleaning
test-clean:
-@rm -rf _build