-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (31 loc) · 1.04 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
PROG=PLexceptGOTOdotNET
all: exe web
exe: bin/$(PROG).exe
bin/$(PROG).exe:
ifeq (, $(shell command -v ghc 2>/dev/null))
echo "ghc not found in PATH, skipping exe build"
else
(cd src && ghc --make Main.hs -o ../bin/$(PROG).exe)
endif
# For the web build to work, you need parsec installed in a way where haste can use it:
#
# haste-cabal install parsec-3.1.1
#
# Later versions might not work. For example, 3.1.13.0 fails to build for me at:
# Preprocessing library generic-deriving-1.12.3...
# src/Generics/Deriving/TH/Pre4_9.hs:177:20:
# parse error on input ‘->’
#
# The hastec from containerized-hastec comes with parsec already installed this way.
web: demo/$(PROG).js
demo/$(PROG).js:
ifeq (, $(shell command -v hastec 2>/dev/null))
echo "hastec not found in PATH, skipping web build"
else
(cd src && hastec --make HasteMain.hs -o $(PROG).js && mv $(PROG).js ../demo/$(PROG).js)
endif
clean:
rm -f bin/$(PROG).exe demo/$(PROG).js
find . -name '*.o' -exec rm {} \;
find . -name '*.hi' -exec rm {} \;
find . -name '*.jsmod' -exec rm {} \;