/
Makefile
89 lines (71 loc) · 1.88 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
include Makefile.config
byte = _obuild/ocp-indent/ocp-indent.byte
native = _obuild/ocp-indent/ocp-indent.asm
manpage = man/man1/ocp-indent.1
.PHONY: $(native) $(byte)
all: ocp-indent
@
ocp-indent: $(native)
cp $^ ocp-indent
ALWAYS:
$(byte) byte: ocp-build.root ALWAYS
ocp-build
$(native) native asm: ocp-build.root ALWAYS
ocp-build
$(manpage): ocp-indent
mkdir -p $(@D)
./ocp-indent --help=groff >$@
bootstrap: ocp-indent
./ocp-indent -c match_clause=4 --inplace src/*.mli src/*.ml
sanitize:
ocp-build -sanitize
.PHONY: clean
clean:
ocp-build -clean
.PHONY: distclean
distclean:
ocp-build -distclean
.PHONY: install
install: ocp-indent $(manpage)
@if ocp-build -installed | grep -q ocp-indent; then \
ocp-build -uninstall ocp-indent; \
fi
ocp-build install \
-install-lib $(prefix)/lib/ocp-indent \
-install-bin $(prefix)/bin \
-install-data $(prefix)/share/typerex
mkdir -p $(mandir)/man1
install -m 644 $(manpage) $(mandir)/man1/
@echo
@echo
@echo "=== ocp-indent installed ==="
@echo
@echo "To setup tuareg-mode to use ocp-indent, please add the following"
@echo "line to your .emacs :"
@echo
@echo '(load-file "'$(prefix)/share/typerex/ocp-indent/ocp-indent.el'")'
@echo
@echo "Vim users are welcome to add the following to their .vimrc :"
@echo
@echo "autocmd FileType ocaml source $(prefix)/share/typerex/ocp-indent/ocp-indent.vim"
@echo
.PHONY: uninstall
uninstall:
ocp-build uninstall ocp-indent
rm $(mandir)/man1/$(notdir $(manpage))
.PHONY: test
test: ocp-indent
./tests/test.sh
configure: configure.ac
aclocal -I m4
autoconf
version.ocp: configure.ac
@echo "version.ocp not up-to-date, please rerun ./configure"
@exit 1
ocp-build.root: version.ocp
@if (ocp-build -version 2>/dev/null |\
awk -F'.' '{ exit $$1 > 1 || ($$1 = 1 && $$2 >= 99) }'); then \
echo "Error: you need ocp-build >= 1.99." >&2;\
exit 1;\
fi
ocp-build -init -scan