1 # This Makefile serves as a wrapper to bundle the
2 # extlib package without modifications.
4 # the extlib package is a conventional package that
5 # requires a plain compilation of its .ml files and
6 # then packed into an archive file.
8 ifneq ($(MAKECMDGOALS
),distclean)
9 include ..
/..
/Makefile.config
16 EXTLIB
=extlib-
$(VERSION
)
17 EXTMARKER
=$(EXTLIB
)/.marker
21 all-build
: $(EXTMARKER
) extLib.cma META
24 @
$(MAKE
) all-opt-build
25 all-opt-build
: $(EXTMARKER
) extLib.cmxa META
27 # prepares the source bundle for building.
28 .prepare
: $(EXTMARKER
)
32 rm -f .depend META extLib.cm
[ioxa
] extLib.
[ao
] \
33 $(EXTLIB
)/*.cm
[ioxa
] extLib.cmxa \
42 $(EXTMARKER
): $(EXTLIB
).
tar.gz hashtable-ocaml4-compat.patch
44 $(PATCH
) -d
$(EXTLIB
) -p1
< .
/hashtable-ocaml4-compat.patch
48 @echo
"$@ not found. Please download it and drop it in this directory ($(pwd))."
51 .PHONEY
: all all.opt all-build all-opt-build
clean distclean depend
55 enum bitSet dynArray extArray extHashtbl extList extString global IO option \
56 pMap std uChar uTF8 base64 unzip refList optParse dllist
58 MLI
=$(MODULES
:%=$(EXTLIB
)/%.mli
)
59 SRC
=$(MODULES
:%=$(EXTLIB
)/%.ml
) $(EXTLIB
)/extLib.ml
61 # note: the interface files must be build at must once when compiling both 'all' and 'all.opt'
62 # otherwise errors such as 'module X makes inconsistent assumptions about interface Y' may
63 # arise. The dependencies on this marker establishes this sharing.
64 .mli-marker
: $(MLI
) $(SRC
)
65 $(OCAMLC
) $(OCAMLCFLAGS
) -c
-I
$(EXTLIB
) $(MLI
)
68 extLib.cma
: .mli-marker
$(SRC
)
69 $(OCAMLC
) $(OCAMLCFLAGS
) -a
-I
$(EXTLIB
) -o extLib.cma
$(MLI
) $(SRC
)
71 extLib.cmxa
: .mli-marker
$(SRC
)
72 $(OCAMLOPT
) $(OPTFLAGS
) -a
-I
$(EXTLIB
) -o extLib.cmxa
$(SRC
)
77 include ..
/..
/Makefile.common