Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 212 lines (172 sloc) 6.155 kB
66cb17b @avsm let `make distclean` work idempotently
avsm authored
1 -include Makefile.config
c226d2c @samoht [build] few tweaks to the autoconf scripts
samoht authored
2
512be53 @samoht Add ocp-build's colors back
samoht authored
3 LOCAL_OCPBUILD=./ocp-build/ocp-build -no-use-ocamlfind
2e9698e @samoht [build] fix install when no native code is available
samoht authored
4 OCPBUILD ?= $(LOCAL_OCPBUILD)
334250b @samoht [build] simplified autoconf scripts
samoht authored
5 SRC_EXT=src_ext
96cdd2f @AltGr Added a new 'opam-installer' script to make .install files usable out…
AltGr authored
6 TARGETS = opam opam-admin opam-installer
750fc50 @samoht Add a first build skeleton
samoht authored
7
8 .PHONY: all
9
d67a12d @samoht Fix compilation from source archives when using already-installed pac…
samoht authored
10 all: $(LOCAL_OCPBUILD) META
061a376 @samoht [build] fix build to use the latest version of ocaml-re
samoht authored
11 $(MAKE) clone
12 $(MAKE) compile
750fc50 @samoht Add a first build skeleton
samoht authored
13
c229cf1 @avsm Support `make cold` to build OPAM without an OCaml compiler being ava…
avsm authored
14 cold:
7cc489d @avsm bootstrap: typo in Makefile
avsm authored
15 ./shell/bootstrap-ocaml.sh
c229cf1 @avsm Support `make cold` to build OPAM without an OCaml compiler being ava…
avsm authored
16 env PATH=$$PATH:`pwd`/bootstrap/ocaml/bin ./configure
17 env PATH=$$PATH:`pwd`/bootstrap/ocaml/bin $(MAKE)
1fc0824 @samoht Clean more files
samoht authored
18
8d1116a ocp-build: update with most recent version
Fabrice Le Fessant authored
19 scan: $(LOCAL_OCPBUILD)
750fc50 @samoht Add a first build skeleton
samoht authored
20 $(OCPBUILD) -scan
8d1116a ocp-build: update with most recent version
Fabrice Le Fessant authored
21 sanitize: $(LOCAL_OCPBUILD)
2a2b583 @samoht Fix Makefile after upgrade to the latest version
samoht authored
22 $(OCPBUILD)
8d1116a ocp-build: update with most recent version
Fabrice Le Fessant authored
23 byte: $(LOCAL_OCPBUILD)
750fc50 @samoht Add a first build skeleton
samoht authored
24 $(OCPBUILD) -byte
8d1116a ocp-build: update with most recent version
Fabrice Le Fessant authored
25 opt: $(LOCAL_OCPBUILD)
750fc50 @samoht Add a first build skeleton
samoht authored
26 $(OCPBUILD) -asm
9948172 @samoht add str.cma to unixrun (useful to bootstrap ocp-get, as dose and cudf…
samoht authored
27
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
28 OCAMLBUILD_FLAGS=\
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
29 -Is src/core,src/client,src/repositories,src/solver,src/scripts \
cdc77f3 @samoht Fix 'make with-ocamlbuild'
samoht authored
30 -use-ocamlfind -pkgs re.glob,re.pcre,re.str,re.perl,ocamlgraph,cmdliner,cudf,dose3 \
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
31 -classic-display
32 with-ocamlbuild: autogen
33 @for i in core repositories solver client; do\
34 echo Compiling opam-$$i;\
6fcd3db @samoht OpamClient.SafeAPI can now be used in a toplevel.
samoht authored
35 find src/$$i -type f \( -not -name opamMain.ml \) \
36 \( -name \*.ml -or -name \*.mly -or -name \*.mll \)\
e914060 @avsm fixes for `make with-ocamlbuild` to work
avsm authored
37 | xargs -n 1 basename\
62e9a0b @samoht Install lexers and parsers as well.
samoht authored
38 | awk -F. "{ print (toupper(substr(\$$1,0,1)) substr(\$$1,2)) }"\
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
39 > src/$$i/opam-$$i.mllib &&\
6fcd3db @samoht OpamClient.SafeAPI can now be used in a toplevel.
samoht authored
40 ocamlbuild $(OCAMLBUILD_FLAGS) opam-$$i.cma opam-$$i.cmxa;\
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
41 done;\
74c1224 @dsheets Actually build opam_admin.native since a67bb720f99497c85e1afd01213044…
dsheets authored
42 ocamlbuild $(OCAMLBUILD_FLAGS) opamMain.native opam_admin.native &&\
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
43 ln -sf _build/src/client/opamMain.native opam &&\
a67bb72 @AltGr Bundled opam-mk-repo and opam-repo-check in opam-admin
AltGr authored
44 ln -sf _build/src/scripts/opam_admin.native opam-admin
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
45
8d1116a ocp-build: update with most recent version
Fabrice Le Fessant authored
46 $(LOCAL_OCPBUILD): ocp-build/ocp-build.boot ocp-build/win32_c.c
47 $(MAKE) -C ocp-build
750fc50 @samoht Add a first build skeleton
samoht authored
48
8fcaae2 @samoht [build] add a 'prepare' target to use packages installed on the syste…
samoht authored
49 OCAMLFIND_DIR=$(shell ocamlfind printconf destdir)
50 prepare: depends.ocp.in
51 sed "s|%{lib}%|$(OCAMLFIND_DIR)|g" depends.ocp.in > depends.ocp
52
782ca5a @samoht Better error message when you forget to run ./configure
samoht authored
53 autogen: src/core/opamGitVersion.ml src/core/opamScript.ml src/core/opamVersion.ml
d5d9ccb @samoht Get ride of `eval` in some cases and start configuring OPAM globally.
samoht authored
54
55 compile: $(LOCAL_OCPBUILD) autogen
2a2b583 @samoht Fix Makefile after upgrade to the latest version
samoht authored
56 $(OCPBUILD) -init -scan $(TARGET)
750fc50 @samoht Add a first build skeleton
samoht authored
57
782ca5a @samoht Better error message when you forget to run ./configure
samoht authored
58 clone: src/core/opamVersion.ml
cef3112 @cago Moved external source in src_ext/
cago authored
59 $(MAKE) -C $(SRC_EXT)
750fc50 @samoht Add a first build skeleton
samoht authored
60
61 clean:
b1c2162 @samoht Fix Makefile
samoht authored
62 rm -rf _obuild
5c162f0 @tuong clean generated files
tuong authored
63 rm -f *.annot src/*.annot
b1c2162 @samoht Fix Makefile
samoht authored
64 rm -f ocp-build.*
29c926e @samoht Fix clean target
samoht authored
65 rm -rf _build
1fc0824 @samoht Clean more files
samoht authored
66 rm -rf config.log config.status META Makefile.config
cef3112 @cago Moved external source in src_ext/
cago authored
67 $(MAKE) -C $(SRC_EXT) clean
794cbf8 ocp-build: remove useless directory boot
Fabrice Le Fessant authored
68 $(MAKE) -C ocp-build clean
8d83b00 @samoht Fix the creation of the full archive
samoht authored
69 rm -f $(OPAM_FULL_TARGZ)
750fc50 @samoht Add a first build skeleton
samoht authored
70
cef3112 @cago Moved external source in src_ext/
cago authored
71 distclean: clean
72 $(MAKE) -C $(SRC_EXT) distclean
1e6ab00 @samoht More portable Makefile
samoht authored
73 rm -f META Makefile.config config.log config.status
74 rm -f src/core/opamVersion.ml src/core/opamGitVersion.ml src/core/opamScript.ml
7f510c5 @samoht Few makefile tweaks
samoht authored
75
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
76 .PHONY: tests
77
7f510c5 @samoht Few makefile tweaks
samoht authored
78 tests:
ec59f94 @samoht [tests] make tests should test all the backends
samoht authored
79 $(MAKE) -C tests all
80
0e2c647 @samoht Fix Makefile oldity
samoht authored
81 tests-local:
82 $(MAKE) -C tests local
f8dc221 @samoht Add --root to ocp-get and ocp-get-server to change the default root p…
samoht authored
83
638dc66 @samoht [build] add make tests-git target
samoht authored
84 tests-git:
85 $(MAKE) -C tests git
d72de1d @samoht More cleanups
samoht authored
86
87 %-install:
ba0b854 @samoht Less verbose install target
samoht authored
88 @if [ -e _obuild/$*/$*.asm ]; then \
89 echo "install _obuild/$*/$*.asm" && \
7d1e6c1 @jonludlam Make sure Makefile respects the DESTDIR parameter
jonludlam authored
90 cp _obuild/$*/$*.asm $(DESTDIR)$(prefix)/bin/$*; \
2e9698e @samoht [build] fix install when no native code is available
samoht authored
91 else \
ba0b854 @samoht Less verbose install target
samoht authored
92 echo "install _obuild/$*/$*.byte" && \
7d1e6c1 @jonludlam Make sure Makefile respects the DESTDIR parameter
jonludlam authored
93 cp _obuild/$*/$*.byte $(DESTDIR)$(prefix)/bin/$*; \
2e9698e @samoht [build] fix install when no native code is available
samoht authored
94 fi
334250b @samoht [build] simplified autoconf scripts
samoht authored
95
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
96 %-install-with-ocamlbuild:
97 @if [ -e $* ]; then\
98 echo "install $*" && cp $* $(DESTDIR)$(prefix)/bin/$*;\
99 fi
100
7f7724c @samoht Add a basic META.in file
samoht authored
101 META: META.in
334250b @samoht [build] simplified autoconf scripts
samoht authored
102 sed 's/@VERSION@/$(version)/g' < $< > $@
7f7724c @samoht Add a basic META.in file
samoht authored
103
782ca5a @samoht Better error message when you forget to run ./configure
samoht authored
104 src/core/opamVersion.ml:
105 @echo
106 @echo " ERROR: you need to run ./configure."
107 @echo
108 @exit 1
109
99fb405 @samoht Replace the ugly shell script into a awesome ocamlscript
samoht authored
110 .PHONY: src/core/opamGitVersion.ml
111 src/core/opamGitVersion.ml:
112 ocaml shell/get-git-id.ml $@
136bc9b @samoht Fix #455
samoht authored
113
782ca5a @samoht Better error message when you forget to run ./configure
samoht authored
114 src/core/opamScript.ml: shell/ src/core/opamVersion.ml
1e6ab00 @samoht More portable Makefile
samoht authored
115 ocaml shell/crunch.ml "complete" < shell/opam_completion.sh > $@
116 ocaml shell/crunch.ml "complete_zsh" < shell/opam_completion_zsh.sh >> $@
117 ocaml shell/crunch.ml "switch_eval" < shell/opam_switch_eval.sh >> $@
d5d9ccb @samoht Get ride of `eval` in some cases and start configuring OPAM globally.
samoht authored
118
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
119 .PHONY: uninstall install install-with-ocamlbuild
f09920f @samoht Start fixing the converter from 0.3 to 0.4
samoht authored
120 install:
7d1e6c1 @jonludlam Make sure Makefile respects the DESTDIR parameter
jonludlam authored
121 mkdir -p $(DESTDIR)$(prefix)/bin
f09920f @samoht Start fixing the converter from 0.3 to 0.4
samoht authored
122 $(MAKE) $(TARGETS:%=%-install)
7d1e6c1 @jonludlam Make sure Makefile respects the DESTDIR parameter
jonludlam authored
123 mkdir -p $(DESTDIR)$(mandir)/man1 && cp doc/man/* $(DESTDIR)$(mandir)/man1
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
124 install-with-ocamlbuild:
125 mkdir -p $(DESTDIR)$(prefix)/bin
126 $(MAKE) $(TARGETS:%=%-install-with-ocamlbuild)
127 mkdir -p $(DESTDIR)$(mandir)/man1 && cp doc/man/* $(DESTDIR)$(mandir)/man1
fc51e07 Added man-src, man, and a rule for Makefile
Vincent Bernardoff authored
128 uninstall:
c226d2c @samoht [build] few tweaks to the autoconf scripts
samoht authored
129 rm -f $(prefix)/bin/opam*
130 rm -f $(mandir)/man1/opam*
e04535c @samoht Add API documentation
samoht authored
131
57bb526 @samoht Install all the API libraries
samoht authored
132 CORE_LIB = opam-core
133 REPO_LIB = opam-repositories
134 SOLVER_LIB = opam-solver
135 CLIENT_LIB = opam-client
136
62e9a0b @samoht Install lexers and parsers as well.
samoht authored
137 CORE_NOMLI = opamGlobals.ml opamParser.ml opamLexer.ml opamLineLexer.ml
57bb526 @samoht Install all the API libraries
samoht authored
138 CORE_MLI = $(foreach i, $(shell find src/core -name "*.mli"), $(notdir $i))
139 REPO_MLI = $(foreach i, $(shell find src/repositories -name "*.mli"), $(notdir $i))
140 SOLVER_MLI = $(foreach i, $(shell find src/solver -name "*.mli"), $(notdir $i))
141 CLIENT_MLI = $(foreach i, $(shell find src/client -name "*.mli"), $(notdir $i))
142
143 CORE_FILES = $(CORE_LIB:%=%.a) $(CORE_LIB:%=%.cma) $(CORE_LIB:%=%.cmxa)\
144 $(CORE_MLI:%.mli=%.cmi) $(CORE_NOMLI:%.ml=%.cmi)
145 REPO_FILES = $(REPO_LIB:%=%.a) $(REPO_LIB:%=%.cma) $(REPO_LIB:%=%.cmxa)\
146 $(REPO_MLI:%.mli=%.cmi)
147 SOLVER_FILES = $(SOLVER_LIB:%=%.a) $(SOLVER_LIB:%=%.cma) $(SOLVER_LIB:%=%.cmxa)\
148 $(SOLVER_MLI:%.mli=%.cmi)
149 CLIENT_FILES = $(CLIENT_LIB:%=%.a) $(CLIENT_LIB:%=%.cma) $(CLIENT_LIB:%=%.cmxa)\
150 $(CLIENT_MLI:%.mli=%.cmi)
151
152 FILES = $(CORE_FILES:%=_obuild/opam-core/%)\
153 $(REPO_FILES:%=_obuild/opam-repositories/%)\
154 $(SOLVER_FILES:%=_obuild/opam-solver/%)\
155 $(CLIENT_FILES:%=_obuild/opam-client/%)
022a533 @samoht [build] libinstall depends on META
samoht authored
156
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
157 OCAMLBUILD_FILES =\
158 $(CORE_FILES:%=_build/src/core/%)\
159 $(REPO_FILES:%=_build/src/repositories/%)\
160 $(SOLVER_FILES:%=_build/src/solver/%)\
161 $(CLIENT_FILES:%=_build/src/client/%)
162
4b204b8 @samoht Also compile the scripts with ocamlbuild, and add a install-with-ocam…
samoht authored
163 .PHONY: libuninstall libinstall libinstall-with-ocamlbuild
022a533 @samoht [build] libinstall depends on META
samoht authored
164 libinstall: META
59b4a38 @samoht make libinstall should be idempotent
samoht authored
165 $(MAKE) libuninstall
b3f54cb @samoht [build] add a libinstall target
samoht authored
166 ocamlfind install opam META $(FILES)
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
167 libinstall-with-ocamlbuild: META
59b4a38 @samoht make libinstall should be idempotent
samoht authored
168 $(MAKE) libuninstall
3d9ad42 @samoht Add ocamlbuild rules to build and install OPAM.
samoht authored
169 ocamlfind install opam META $(OCAMLBUILD_FILES)
b3f54cb @samoht [build] add a libinstall target
samoht authored
170 libuninstall:
171 ocamlfind remove opam
172
e04535c @samoht Add API documentation
samoht authored
173 doc: compile
987a306 @samoht Add a Makefile to generate the man pages
samoht authored
174 $(MAKE) -C doc
0b3eeea @samoht Add a rule in Makefile to remove trailing blank lines in ml/mli
samoht authored
175
ddf25e2 @samoht Update the release/upload targets
samoht authored
176 OPAM_FULL = opam-full-$(version)
177 OPAM_FULL_TARGZ = $(OPAM_FULL).tar.gz
178
3cff299 @samoht Generate and upload a full archive for a given version.
samoht authored
179 OPAM_FILES = $(wildcard src_ext/*.tar.gz)\
180 $(wildcard src_ext/*.tbz)\
181 $(shell git ls-tree --name-only -r HEAD)
182
8d83b00 @samoht Fix the creation of the full archive
samoht authored
183 prepare-archive:
1f0c039 @samoht Fix the creation of a big archive
samoht authored
184 $(MAKE) -C src_ext distclean
812e1c9 @samoht [build] use the versions of ocaml-re and ocaml-arg
samoht authored
185 $(MAKE) clone
3cff299 @samoht Generate and upload a full archive for a given version.
samoht authored
186 rm -f $(OPAM_FULL) $(OPAM_FULL).tar.gz
187 ln -s . $(OPAM_FULL)
8d83b00 @samoht Fix the creation of the full archive
samoht authored
188
189 # we want OPAM_FILES to be up-to-date here
190 complete-archive:
3cff299 @samoht Generate and upload a full archive for a given version.
samoht authored
191 tar cz $(addprefix $(OPAM_FULL)/,$(OPAM_FILES)) > $(OPAM_FULL).tar.gz
192 rm -f $(OPAM_FULL)
193
8d83b00 @samoht Fix the creation of the full archive
samoht authored
194 $(OPAM_FULL_TARGZ):
195 $(MAKE) prepare-archive
196 $(MAKE) complete-archive
197
198 archive: $(OPAM_FULL_TARGZ)
199 @
ddf25e2 @samoht Update the release/upload targets
samoht authored
200 upload: $(OPAM_FULL_TARGZ)
201 scp $(OPAM_FULL_TARGZ) webmaster@ocamlpro.com:pub/
334250b @samoht [build] simplified autoconf scripts
samoht authored
202
203 configure: configure.ac m4/*.m4
204 aclocal -I m4
7d1e6c1 @jonludlam Make sure Makefile respects the DESTDIR parameter
jonludlam authored
205 autoconf
c1d1c08 @samoht Add a 'release' target to facilitate releases
samoht authored
206
207 release:
4f3faee @samoht Fix release target
samoht authored
208 git tag -d latest || true
c1d1c08 @samoht Add a 'release' target to facilitate releases
samoht authored
209 git tag -a latest -m "Latest release"
210 git tag -a $(version) -m "Release $(version)"
211 $(MAKE) upload
Something went wrong with that request. Please try again.