git @ Cat's Eye Technologies Emmental / rel_1_0_2021_1022
Add Makefile to repository. Chris Pressey 3 years ago
1 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 PROG=emmental
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 web: demo/$(PROG).js
14
15 demo/$(PROG).js:
16 ifeq (, $(shell command -v hastec 2>/dev/null))
17 echo "hastec not found in PATH, skipping web build"
18 else
19 (cd src && hastec --make HasteMain.hs -o $(PROG).js && mv $(PROG).js ../demo/$(PROG).js)
20 endif
21
22 clean:
23 rm -f bin/$(PROG).exe demo/$(PROG).js
24 find . -name '*.o' -exec rm {} \;
25 find . -name '*.hi' -exec rm {} \;
26 find . -name '*.jsmod' -exec rm {} \;