[ocaml-extlib] r428 committed - install extlib_min package with reduced set of modules (Closes issue 2...

1 view
Skip to first unread message

codesite...@google.com

unread,
Nov 23, 2013, 1:28:56 PM11/23/13
to ocaml-extl...@googlegroups.com
Revision: 428
Author: ygrekheretix
Date: Sat Nov 23 18:28:39 2013 UTC
Log: install extlib_min package with reduced set of modules (Closes
issue 23)

http://code.google.com/p/ocaml-extlib/source/detail?r=428

Added:
/trunk/extlib/min
/trunk/extlib/min/META
Modified:
/trunk/extlib
/trunk/extlib/Makefile

=======================================
--- /dev/null
+++ /trunk/extlib/min/META Sat Nov 23 18:28:39 2013 UTC
@@ -0,0 +1,7 @@
+description="Extended standard library (stripped of potentially
conflicting modules)"
+archive(byte)="extLib_min.cma"
+archive(native)="extLib_min.cmxa"
+archive(byte, plugin) = "extLib_min.cma"
+archive(native, plugin) = "extLib_min.cmxs"
+exists_if = "extLib_min.cma"
+error(pkg_extlib) = "extlib_min and extlib shouldn't be used together"
=======================================
--- /trunk/extlib/Makefile Tue Nov 12 04:19:31 2013 UTC
+++ /trunk/extlib/Makefile Sat Nov 23 18:28:39 2013 UTC
@@ -2,37 +2,67 @@

VERSION = 1.5.4

+# the list is topologically sorted
MODULES = \
enum bitSet dynArray extArray extHashtbl extList extString global IO
option \
- pMap std uChar uTF8 base64 unzip refList optParse dllist
+ pMap std uChar uTF8 base64 unzip refList optParse dllist extLib

-# the list is topologically sorted
+MODULES_MIN = $(filter-out base64 unzip uChar uTF8, $(MODULES))

-MLI = $(MODULES:=.mli)
+OCAMLC = ocamlc -g
+OCAMLOPT = ocamlopt -g
+
+MLI = $(filter-out extLib.mli, $(MODULES:=.mli))
CMI = $(MODULES:=.cmi)
+CMO = $(MODULES:=.cmo)
CMX = $(MODULES:=.cmx)
-SRC = $(MLI) $(MODULES:=.ml) extLib.ml

-.PHONY: all opt cmxs doc install uninstall clean release
+MLI_MIN = $(filter-out extLib.mli, $(MODULES_MIN:=.mli))
+CMI_MIN = $(MODULES_MIN:=.cmi)
+CMO_MIN = $(MODULES_MIN:=.cmo)
+CMX_MIN = $(MODULES_MIN:=.cmx)

-build: all opt
+.SUFFIXES:
+.PHONY: build all opt cmxs doc install uninstall clean release
+
+build: all opt cmxs
+
+all: extLib.cma extLib_min.cma
+opt: extLib.cmxa extLib_min.cmxa
+cmxs: extLib.cmxs extLib_min.cmxs
+
+doc:
+ $(OCAMLC) -c $(MLI)
+ ocamldoc -sort -html -d doc/ $(MLI) extLib.ml
+
+extLib.cma: $(CMO)
+ $(OCAMLC) -a -o $@ $^
+extLib_min.cma: $(CMO_MIN)
+ $(OCAMLC) -a -o $@ $^
+extLib.cmxa: $(CMX)
+ $(OCAMLOPT) -a -o $@ $^
+extLib_min.cmxa: $(CMX_MIN)
+ $(OCAMLOPT) -a -o $@ $^
+%.cmxs: %.cmxa
+ $(OCAMLOPT) -shared -linkall $< -o $@
+%.cmo: %.mli %.ml
+ $(OCAMLC) -c $^
+%.cmx: %.mli %.ml
+ $(OCAMLOPT) -c $^
+extLib.cmo: extLib.ml
+ $(OCAMLC) -c $<
+extLib.cmx: extLib.ml
+ $(OCAMLOPT) -c $<
extHashtbl.ml: extHashtbl.mlpp
camlp4of pr_o.cmo $(shell ocaml configure.ml) -impl $< -o $@
-all: $(SRC)
- ocamlc -g -a -o extLib.cma $(SRC)
-opt: $(SRC)
- ocamlopt -g -a -o extLib.cmxa $(SRC)
-cmxs: opt
- ocamlopt -shared -linkall extLib.cmxa -o extLib.cmxs
-doc:
- ocamlc -c $(MLI)
- ocamldoc -sort -html -d doc/ $(MLI)

install:
- ocamlfind install -patch-version $(VERSION) extlib META extLib.cma
extLib.cmi $(MLI) $(CMI) -optional extLib.cmxa $(CMX) extLib.cmxs extLib.a
extLib.lib
+ ocamlfind install -patch-version $(VERSION) extlib META extLib.cma $(MLI)
$(CMI) -optional extLib.cmxa $(CMX) extLib.cmxs extLib.a extLib.lib
+ ocamlfind install -patch-version $(VERSION) extlib_min min/META
extLib_min.cma $(MLI_MIN) $(CMI_MIN) -optional extLib_min.cmxa $(CMX_MIN)
extLib_min.cmxs extLib_min.a extLib_min.lib

uninstall:
ocamlfind remove extlib
+ ocamlfind remove extlib_min

clean:
rm -f *.cmo *.cmx *.o *.obj *.cmi *.cma *.cmxa *.cmxs *.a *.lib
doc/*.html extHashtbl.ml
Reply all
Reply to author
Forward
0 new messages