-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathMakefile
82 lines (66 loc) · 1.55 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
PACKAGES = \
repa-eval \
repa-scalar \
repa-stream \
repa-convert \
repa-array \
repa-flow \
repa-store \
repa-query
# Build the standard library.
.PHONY : all
all :
@make packages
@make tools
@make examples
# Build and install all the Cabal packages.
.PHONY : packages
packages :
@for package in ${PACKAGES}; do \
if [ `ghc-pkg list $${package} --simple-output | wc -l` -gt 0 ]; then \
echo "* Skipping $${package}; already installed"; \
continue; \
fi; \
cd $${package}; \
echo "* Building $${package}"; \
cabal install --enable-documentation --force-reinstalls;\
if [ $$? -ne 0 ]; then \
echo "* Error in $${package}!"; \
break; \
fi; \
cd ..; \
echo; \
done;
# Build the tools.
.PHONY : tools
tools :
@cd repa-tools; cabal install
# Build the examples
.PHONY : examples
examples :
@cd repa-examples; cabal install
# Unregister all the Cabal packages.
.PHONY : unregister
unregister :
@echo "* Unregistering packages"
@for package in ${PACKAGES}; do \
if [ `ghc-pkg list $${package} --simple-output | wc -l` -gt 0 ]; then \
echo "* Unregistering $${package}"; \
ghc-pkg unregister $${package} --force 2> /dev/null; \
if [ $$? -ne 0 ]; then \
continue; \
fi; \
fi; \
done;
# Unregister all the packages, then reinstall them.
.PHONY : reinstall
reinstall :
@make unregister
@make packages
# Clean out all the junk.
.PHONY : clean
clean :
@for package in ${PACKAGES} repa-examples repa-tools; do \
rm -Rf $${package}/dist; \
done;
@find . -name '.DS_Store' -or -name '._.DS_Store' | xargs rm -f