File: Makefile

package info (click to toggle)
ppx-deriving-yojson 3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 208 kB
  • sloc: ml: 1,306; makefile: 57; sh: 15
file content (51 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download
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
OCAMLOPT := $(shell which ocamlopt)
ifeq ($(OCAMLOPT),)
	NATIVE := false
else
	NATIVE := true
endif

build:
	cp pkg/META.in pkg/META
	ocaml pkg/build.ml native=$(NATIVE) native-dynlink=$(NATIVE)

test: build
	rm -rf _build/src_test/
	ocamlbuild -j 0 -use-ocamlfind -classic-display \
						 src_test/test_ppx_yojson.byte --

doc:
	ocamlbuild -use-ocamlfind doc/api.docdir/index.html \
						 -docflags -t -docflag "API reference for ppx_deriving_yojson" \
						 -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

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)

.PHONY: gh-pages release