Merge tag 'rel_1_0_2021_1206'
Chris Pressey
10 months ago
|
0 |
PROG=pail
|
|
1 |
|
|
2 |
all: exe web
|
|
3 |
|
|
4 |
exe: bin/$(PROG).exe
|
|
5 |
|
|
6 |
bin/$(PROG).exe:
|
|
7 |
ifeq (, $(shell command -v ghc 2>/dev/null))
|
|
8 |
echo "ghc not found in PATH, skipping exe build"
|
|
9 |
else
|
|
10 |
(cd src && ghc --make Main.hs -o ../bin/$(PROG).exe)
|
|
11 |
endif
|
|
12 |
|
|
13 |
# For the web build to work, you need parsec installed in a way where haste can use it:
|
|
14 |
#
|
|
15 |
# haste-cabal install parsec-3.1.1
|
|
16 |
#
|
|
17 |
# Later versions might not work. For example, 3.1.13.0 fails to build for me at:
|
|
18 |
# Preprocessing library generic-deriving-1.12.3...
|
|
19 |
# src/Generics/Deriving/TH/Pre4_9.hs:177:20:
|
|
20 |
# parse error on input ‘->’
|
|
21 |
#
|
|
22 |
# The hastec from containerized-hastec comes with parsec already installed this way.
|
|
23 |
|
|
24 |
web: demo/$(PROG).js
|
|
25 |
|
|
26 |
demo/$(PROG).js:
|
|
27 |
ifeq (, $(shell command -v hastec 2>/dev/null))
|
|
28 |
echo "hastec not found in PATH, skipping web build"
|
|
29 |
else
|
|
30 |
(cd src && hastec --make HasteMain.hs -o $(PROG).js && mv $(PROG).js ../demo/$(PROG).js)
|
|
31 |
endif
|
|
32 |
|
|
33 |
clean:
|
|
34 |
rm -f bin/$(PROG).exe demo/$(PROG).js
|
|
35 |
find . -name '*.o' -exec rm {} \;
|
|
36 |
find . -name '*.hi' -exec rm {} \;
|
|
37 |
find . -name '*.jsmod' -exec rm {} \;
|
0 | |
#!/bin/sh
|
1 | |
|
2 | |
PROG=pail
|
3 | |
|
4 | |
if command -v ghc >/dev/null 2>&1; then
|
5 | |
echo "building $PROG.exe with ghc"
|
6 | |
(cd src && ghc --make Main.hs -o ../bin/$PROG.exe)
|
7 | |
else
|
8 | |
echo "ghc not found, not building $PROG.exe"
|
9 | |
fi
|
10 | |
|
11 | |
# For this to work, you need hastec installed.
|
12 | |
# You also need parsec installed in a way that haste can use it:
|
13 | |
#
|
14 | |
# haste-cabal install parsec-3.1.1
|
15 | |
#
|
16 | |
# Later versions might not work. For example, 3.1.13.0 fails to build for me at:
|
17 | |
# Preprocessing library generic-deriving-1.12.3...
|
18 | |
# src/Generics/Deriving/TH/Pre4_9.hs:177:20:
|
19 | |
# parse error on input ‘->’
|
20 | |
#
|
21 | |
|
22 | |
if command -v hastec >/dev/null 2>&1; then
|
23 | |
echo "building $PROG.js with hastec"
|
24 | |
(cd src && hastec --make HasteMain.hs -o $PROG.js && mv $PROG.js ../demo/)
|
25 | |
else
|
26 | |
echo "hastec not found, not building $PROG.js"
|
27 | |
fi
|
0 | |
#!/bin/sh
|
1 | |
|
2 | |
find . -name "*.o" -exec rm {} \;
|
3 | |
find . -name "*.hi" -exec rm {} \;
|
4 | |
find . -name "*.jsmod" -exec rm {} \;
|
5 | |
find . -name "*.exe" -exec rm {} \;
|