forked from mirage/ocaml-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (52 loc) · 1.57 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
VERSION = $(shell grep 'Version:' _oasis | sed 's/Version: *//')
VFILE = lib/version.ml
SETUP = ocaml setup.ml
build: setup.data $(VFILE)
$(SETUP) -build $(BUILDFLAGS)
doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)
test: setup.data build
$(SETUP) -test $(TESTFLAGS)
all: $(VFILE)
$(SETUP) -all $(ALLFLAGS)
install: setup.data
$(SETUP) -install $(INSTALLFLAGS)
uninstall: setup.data
$(SETUP) -uninstall $(UNINSTALLFLAGS)
reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)
clean:
$(SETUP) -clean $(CLEANFLAGS)
rm -f $(VFILE)
distclean:
$(SETUP) -distclean $(DISTCLEANFLAGS)
setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)
configure:
$(SETUP) -configure $(CONFIGUREFLAGS)
.PHONY: build doc test all install uninstall reinstall clean distclean configure
# OASIS_STOP
$(VFILE): _oasis
echo "let current = \"$(VERSION)\"" > $@
init-doc:
mkdir -p gh-pages
cd gh-pages
git init
git remote add origin git@github.com:mirage/ocaml-git.git
git checkout gh-pages
git pull
update-doc: doc
rm -f gh-pages/*.html
cd gh-pages && cp ../git.docdir/*.html .
cd gh-pages && git add * && git commit -a -m "Update docs"
cd gh-pages && git push
VERSION = $(shell grep 'Version:' _oasis | sed 's/Version: *//')
NAME = $(shell grep 'Name:' _oasis | sed 's/Name: *//')
ARCHIVE = https://github.com/mirage/ocaml-$(NAME)/archive/$(VERSION).tar.gz
release:
git tag -a $(VERSION) -m "Version $(VERSION)."
git push upstream $(VERSION)
$(MAKE) pr
pr:
opam publish prepare $(NAME).$(VERSION) $(ARCHIVE)
opam publish submit $(NAME).$(VERSION) && rm -rf $(NAME).$(VERSION)