forked from ocaml/opam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
147 lines (113 loc) · 3.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
-include Makefile.config
all: opam-lib opam opam-admin opam-installer
@
ALWAYS:
@
opam-lib opam opam-admin opam-installer all: ALWAYS
#backwards-compat
compile with-ocamlbuild: all
@
install-with-ocamlbuild: install
@
libinstall-with-ocamlbuild: libinstall
@
byte:
$(MAKE) all USE_BYTE=true
src/%:
$(MAKE) -C src $*
%:
$(MAKE) -C src $@
lib-ext:
$(MAKE) -C src_ext lib-ext
download-ext:
$(MAKE) -C src_ext archives
clean-ext:
$(MAKE) -C src_ext distclean
clean:
$(MAKE) -C src $@
$(MAKE) -C doc $@
OPAMINSTALLER_FLAGS = --prefix $(DESTDIR)$(prefix)
OPAMINSTALLER_FLAGS += --mandir $(DESTDIR)$(mandir)
# With ocamlfind, prefer to install to the standard directory rather
# than $(prefix) if there are no overrides
ifndef DESTDIR
ifneq ($(OCAMLFIND),no)
LIBINSTALL_DIR ?= $(shell $(OCAMLFIND) printconf destdir)
endif
endif
ifneq ($(LIBINSTALL_DIR),)
OPAMINSTALLER_FLAGS += --libdir $(LIBINSTALL_DIR)
endif
opam-%.install:
$(MAKE) -C src ../opam-$*.install
libinstall: opam-lib.install opam-admin.top
$(if $(wildcard src_ext/lib/*),$(error Installing the opam libraries is incompatible with embedding the dependencies. Run 'make clean-ext' and try again))
src/opam-installer $(OPAMINSTALLER_FLAGS) opam-lib.install
install:
src/opam-installer $(OPAMINSTALLER_FLAGS) opam.install
libuninstall:
src/opam-installer -u $(OPAMINSTALLER_FLAGS) opam-lib.install
uninstall:
src/opam-installer -u $(OPAMINSTALLER_FLAGS) opam.install
.PHONY: tests tests-local tests-git
tests: opam opam-admin opam-check
$(MAKE) -C tests all
# tests-local, tests-git
tests-%: opam opam-admin opam-check
$(MAKE) -C tests $*
.PHONY: doc
doc: all
$(MAKE) -C doc
.PHONY: man man-html
man man-html: opam opam-admin opam-installer
$(MAKE) -C doc $@
configure: configure.ac m4/*.m4
aclocal -I m4
autoconf
release-tag:
git tag -d latest || true
git tag -a latest -m "Latest release"
git tag -a $(version) -m "Release $(version)"
$(OPAM_FULL).tar.gz:
$(MAKE) -C src_ext distclean
$(MAKE) -C src_ext downloads
rm -f $(OPAM_FULL) $(OPAM_FULL).tar.gz
ln -s .
fastlink:
@$(foreach b,opam opam-admin opam-installer opam-check,\
ln -sf ../_obuild/$b/$b.asm src/$b;)
@$(foreach l,core format solver repository state client,\
$(foreach e,a cma cmxa,ln -sf ../_obuild/opam-$l/opam-$l.$e src/opam-$l.$e;)\
ln -sf $(addprefix ../../,\
$(foreach e,o cmo cmx cmxs cmi cmt cmti,$(wildcard _obuild/opam-$l/*.$e)))\
src/$l/;)
@ln -sf ../_obuild/opam-admin.top/opam-admin.top.byte src/opam-admin.top
@ln -sf $(addprefix ../../,\
$(foreach e,o cmo cmx cmxs cmi cmt cmti,$(wildcard _obuild/opam-admin.top/*.$e)))\
src/tools/;
rmartefacts: ALWAYS
@rm -f $(addprefix src/, opam opam-admin opam-installer opam-check)
@$(foreach l,core format solver repository state client,\
$(foreach e,a cma cmxa,rm -f src/opam-$l.$e;)\
$(foreach e,o cmo cmx cmxs cmi cmt cmti,rm -f $(wildcard src/$l/*.$e);))
prefast: rmartefacts src/client/opamGitVersion.ml src/state/opamScript.ml src/core/opamCompat.ml src/core/opamCompat.mli
@
fast: prefast
@rm -f src/x_build_libs.ocp
@ocp-build init
@ocp-build
@$(MAKE) fastlink
opam-core opam-format opam-solver opam-repository opam-state opam-client opam-tools: prefast
@ocp-build init
@echo "build_libs = [ \"$*\" ]" > src/x_build_libs.ocp
@ocp-build
@rm -f src/x_build_libs.ocp
fastclean: rmartefacts
@rm -f src/x_build_libs.ocp
@ocp-build -clean 2>/dev/null || ocp-build clean 2>/dev/null
@rm -rf src/*/_obuild
cold:
./shell/bootstrap-ocaml.sh
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" ./configure $(CONFIGURE_ARGS)
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" $(MAKE) lib-ext
env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" $(MAKE)