-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
86 lines (70 loc) · 1.89 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
SRC_DIR := src
TEST_DIR := test
ifeq ($(OS),Windows_NT)
EXE := .exe
endif
all: build
build: alloy4.2.jar
stack build
install:
mkdir -p $(to)
cp -f README.md $(to)/clafer-README.md
cp -f LICENSE $(to)/
cp -f CHANGES.md $(to)/clafer-CHANGES.md
cp -f alloy4.2.jar $(to)
cp -f ecore2clafer.jar $(to)
cp `stack path --local-install-root`/bin/clafer$(EXE) $(to)
# regenerate grammar, call after clafer.cf changed
grammar:
$(MAKE) -C $(SRC_DIR) grammar
# Just like "init" but with enabled profiler
# this will reinstall everything with profiling support, build clafer, and copy it to .
prof: alloy4.2.jar
stack build --executable-profiling --library-profiling --ghc-options="-auto-all -caf-all -rtsopts -osuf p_o"
.PHONY: test
test:
cp `stack path --local-install-root`/bin/clafer$(EXE) .
stack test 2>/dev/null || : # supress error message and exit code if fail
$(MAKE) -C $(TEST_DIR) test
generateAlloyJSHTMLDot:
$(MAKE) -C $(TEST_DIR) generateAlloyJSHTMLDot
diffRegressions:
$(MAKE) -C $(TEST_DIR) diffRegressions
reg:
$(MAKE) -C $(TEST_DIR) reg
.PHONY: clean
clean:
$(MAKE) -C $(SRC_DIR) clean
$(MAKE) cleanTools
$(MAKE) cleanTest
stack clean
.PHONY: cleanTest
cleanTest:
$(MAKE) -C $(TEST_DIR) clean
.PHONY: cleanTools
cleanTools:
find . -type f -name '*.class' -print0 | xargs -0 rm -f
.PHONY: tags
tags:
hasktags --ctags --extendedctag --ignore-close-implementation .
.PHONY: codex
codex:
codex update
mv codex.tags tags
WGET_COMMAND := wget
ifeq ($(OS),Windows_NT)
ifeq ($(shell which wget), which: wget: unkown command)
pacman -S make wget
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
WGET_COMMAND := curl -O
endif
endif
alloy4.2.jar:
@if test ! -f "alloy4.2.jar"; then \
echo "[WARNING] Missing alloy4.2.jar. Downloading..."; \
$(WGET_COMMAND) http://alloytools.org/download/alloy4.2_2015-02-22.jar; \
mv alloy4.2_2015-02-22.jar alloy4.2.jar; \
fi