-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathMakefile
57 lines (38 loc) · 1.68 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
targets := logic.js logics.js sessions.js
all: ${targets}
clean:
${RM} -f ${targets} bundle-examples yaml2json
rm -rf logic/dist*
vendor:
mkdir vendor
js-libs:
./install-jslibs.sh
prepare-ghcjs: js-libs
cd logic && cabal build --distdir=dist-newstyle-ghcjs --ghcjs --dependencies-only --disable-tests
prepare-ghc:
cd logic && cabal build --dependencies-only --disable-tests
prepare: prepare-ghc prepare-ghcjs
test-bench:
# check that the benchmarks have not bitrotted
cd logic && cabal run bench -- -n 1
test-hs:
cd logic && LANG=C.utf8 cabal test --test-show-details=direct
test-js: webui/*.js sessions.js logics.js
jshint webui/*.js sessions.js logics.js
test: test-js test-hs test-bench
logic.js: logic/*.cabal logic/*.hs logic/js/*.hs logic/js/*.js
cd logic && cabal new-build --distdir=dist-newstyle-ghcjs --ghcjs
# js-sources in the cabal file stopped working? So concatenate manually
# related to https://github.com/haskell/cabal/pull/5443 maybe?
cat logic/js/js-interface-wrapper.js > $@
cat logic/dist-newstyle-ghcjs/build/*/*/incredible-logic-0.1/x/js-interface/build/js-interface/js-interface.jsexe/all.js >> $@
bundle-examples: logic/*.cabal logic/*.hs logic/examples/*.hs
cd logic && cabal new-build
cp -v logic/dist-newstyle/build/*/*/incredible-logic-0.1/x/bundle-examples/build/bundle-examples/bundle-examples $@
logics.js: logics/* bundle-examples
./bundle-examples logics > $@
yaml2json: logic/*.cabal logic/*.hs logic/examples/*.hs
cd logic && cabal new-build
cp -v logic/dist-newstyle/build/*/*/incredible-logic-0.1/x/yaml2json/build/yaml2json/yaml2json $@
sessions.js: yaml2json sessions.yaml
(echo -n "sessions = "; ./yaml2json sessions.yaml ; echo \;) > $@