forked from hbr/fmlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
127 lines (89 loc) · 2.89 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.PHONY: all
all: doc test
.PHONY: build
build:
dune build
.PHONY: doc
doc:
dune build @doc
.PHONY: sdoc
sdoc:
make -C src/sdoc/ html
.PHONY: examples
examples:
make -C src/examples/browser
.PHONY: test
test:
dune build @runtest
.PHONY: gh-pages-odoc
gh-pages-odoc: doc
# Generate odoc documentation and push it to gh-pages
(cd gh-pages; git rm -r -f odoc); \
mkdir gh-pages/odoc; \
cp -r _build/default/_doc/_html/* gh-pages/odoc/; \
(cd gh-pages; git add odoc; git commit --amend --no-edit; git push -f)
.PHONY: gh-pages-webapp
gh-pages-webapp:
dune build --profile release ./src/examples/browser/webapp.js; \
dune build --profile release ./src/examples/browser/timer.js; \
(cd gh-pages; git rm -r -f webapp); \
mkdir gh-pages/webapp; \
cp src/examples/browser/*.js \
src/examples/browser/*.html \
src/examples/browser/*.json \
gh-pages/webapp/; \
(cd gh-pages; git add webapp; git commit --amend --no-edit; git push -f)
#----------------------------------------------------------------------
# opam support
#----------------------------------------------------------------------
# Write 'opam' files to the opam repository
.PHONY: opam opam_rm
version = 0.5.8
# ---------------------------------------------
opam_repo = ../opam-repository/packages
dir0 = $(opam_repo)/fmlib/fmlib.$(version)
dir_std = $(opam_repo)/fmlib_std/fmlib_std.$(version)
dir_pretty = $(opam_repo)/fmlib_pretty/fmlib_pretty.$(version)
dir_parse = $(opam_repo)/fmlib_parse/fmlib_parse.$(version)
dir_js = $(opam_repo)/fmlib_js/fmlib_js.$(version)
dir_browser = $(opam_repo)/fmlib_browser/fmlib_browser.$(version)
# Don't forget to update the version and the 'url' file
# ^^^^^^^ ^^^^^
# In the 'url' file the version and the md5sum have to
# be updated!!
# -----------------------------------------------------
opam:
mkdir $(dir0); \
cat fmlib.opam url >$(dir0)/opam; \
mkdir -p $(dir_std); \
cat fmlib_std.opam url >$(dir_std)/opam; \
mkdir -p $(dir_pretty); \
cat fmlib_pretty.opam url >$(dir_pretty)/opam; \
mkdir -p $(dir_parse); \
cat fmlib_parse.opam url >$(dir_parse)/opam; \
mkdir -p $(dir_js); \
cat fmlib_js.opam url >$(dir_js)/opam
mkdir -p $(dir_browser); \
cat fmlib_browser.opam url >$(dir_browser)/opam
opam_rm:
rm -rf $(dir0); \
rm -rf $(dir_std); \
rm -rf $(dir_pretty); \
rm -rf $(dir_parse); \
rm -rf $(dir_js); \
rm -rf $(dir_browser)
.PHONY: opam_pin_remove opam_remove
opam_pin_remove:
opam pin remove -n fmlib; \
opam pin remove -n fmlib_std; \
opam pin remove -n fmlib_pretty; \
opam pin remove -n fmlib_parse; \
opam pin remove -n fmlib_js; \
opam pin remove -n fmlib_browser
opam_remove:
opam -y remove fmlib; \
opam -y remove fmlib_std; \
opam -y remove fmlib_pretty; \
opam -y remove fmlib_parse; \
opam -y remove fmlib_js; \
opam -y remove fmlib_browser