forked from hhugo/ppx_deriving
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (48 loc) · 1.66 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
include $(shell ocamlc -where)/Makefile.config
build:
cp pkg/META.in pkg/META
ocaml pkg/build.ml native=true native-dynlink=true
test: build
rm _build/src_test/ -rf
ocamlbuild -j 0 -use-ocamlfind -classic-display \
src_test/test_ppx_deriving.byte --
examples: build
rm _build/src_examples/ -rf
ocamlbuild -j 0 -use-ocamlfind -classic-display \
src_examples/print_test.byte
doc:
ocamlbuild -use-ocamlfind 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)
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`/ppx_deriving_main.native `ocamlfind query ppx_deriving`/ppx_deriving$(EXE)
.PHONY: gh-pages release