-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 2.06 KB
/
Copy pathMakefile
File metadata and controls
68 lines (55 loc) · 2.06 KB
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
include $(shell ocamlc -where)/Makefile.config
OCAMLBUILD=ocamlbuild -j 0 -use-ocamlfind -classic-display \
-plugin-tag 'package(cppo_ocamlbuild)'
build:
cp pkg/META.in pkg/META
ocaml pkg/build.ml native=true native-dynlink=true
test: build
rm -rf _build/src_test/
$(OCAMLBUILD) src_test/test.byte --
examples: build
rm -rf _build/src_test/
$(OCAMLBUILD) src_test/example.byte --
show: build
cd _build && ocamlfind ocamlc -dsource -c -g -bin-annot -safe-string \
-ppx 'ocamlfind ppx_deriving/ppx_deriving src/ppx_deriving_argparse.cma ' \
-I /Users/masashi-y/.opam/4.05.0/lib/ppx_deriving/ \
-w @5@8@10@11@12@14@23@24@26@29@40 -I src_test -I src -o src_test/example.cmo src_test/example.ml
doc:
$(OCAMLBUILD) doc/api.docdir/index.html \
-docflags -t -docflag "API reference for ppx_deriving" \
-docflags '-colorize-code -short-functors -charset utf-8' \
-docflags '-css-style style.css'
cp doc/style.css api.docdir/
clean:
ocamlbuild -clean
.PHONY: build test doc clean examples
gh-pages: doc
git clone `git config --get remote.origin.url` .gh-pages --reference .
git -C .gh-pages checkout --orphan gh-pages
git -C .gh-pages reset
git -C .gh-pages clean -dxf
cp -t .gh-pages/ api.docdir/*
git -C .gh-pages add .
git -C .gh-pages commit -m "Update Pages"
git -C .gh-pages push origin gh-pages -f
rm -rf .gh-pages
VERSION := $$(opam query --version)
NAME_VERSION := $$(opam query --name-version)
ARCHIVE := $$(opam query --archive)
release:
git tag -a v$(VERSION) -m "Version $(VERSION)."
git push origin v$(VERSION)
opam publish prepare $(NAME_VERSION) $(ARCHIVE)
cp -t $(NAME_VERSION) descr
grep -Ev '^(name|version):' opam >$(NAME_VERSION)/opam
opam publish submit $(NAME_VERSION)
rm -rf $(NAME_VERSION)
install:
ocamlfind remove ppx_deriving
grep -E '^[[:space:]]+' ppx_deriving.install | \
awk '{ print $$1 }' | \
sed -e 's:"?*::g' | \
xargs ocamlfind install ppx_deriving
mv `ocamlfind query ppx_deriving -suffix /ppx_deriving_main.native` `ocamlfind query ppx_deriving -suffix /ppx_deriving$(EXE)`
.PHONY: gh-pages release