Commits

camlspotter committed 1cefc52

update

Comments (0)

Files changed (1)

     mkdir $(dir) 
   return
 
+# OCaml -where
+# ========================================================================
+
+#|Path to the OCaml library directory
+OCAML_WHERE = $(shell ocamlc -where)
+
 # OCamlFind
 # ========================================================================
 
 USE_OCAMLFIND = true
 OCAMLFIND_DESTDIR= $(shell ocamlfind printconf destdir)
 
-# OCaml -where
-# ========================================================================
-
-#|Path to the OCaml library directory
-OCAML_WHERE = $(shell ocamlc -where)
-
 #|Preinstalled libraries which are always available for normal ocaml.
 #
 # You may want to add the required packages which are built and installed out of OMy framework:
 #
 # .. note:: Usually you do not need to call this function. Use OCAMLPACKS variable instead. 
 OCamlRequirePackages(packages) =
-    packages += findlib # Yes we use findlib
     required_packs = $(OMyManagedPackages $(packages))
     if $(defined INSTALLED)
       %.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit : $(Installed $(required_packs))
 #
 # .. note:: Usually you do not need to call this function. Use CAML4PACKS variable instead. 
 OCamlRequireCamlP4Packages(packages) =
-    packages += findlib # Yes we use findlib
     required_packs = $(OMyManagedPackages $(packages))
     if $(defined INSTALLED)
       .SCANNER: scan-ocaml-%: $(Installed $(required_packs))
 	    $(OCAMLFIND) ocamldoc -I +threads $(OCAMLPACKAGEFLAGS) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES) -dot -dot-include-all -dot-reduce $+ -o $@
 
 
+#| filter list
+#  example::
+#     is_url(file) =
+#       match $(file)
+#       case $'://'
+#         return true
+#       default
+#         return false
+# 
+#     DOWNLOAD_URLS[]=$(list_filter $(fun x, $(is_url $(x))), $(URLS))
+list_filter(pred, list) =
+  result=
+  foreach(x, $(list))
+    if $(apply $(pred), $(x))
+      result+=$(x)
+      export
+    export
+  return $(result)
+
+#| Obtain files installed as PACK
+GET_OCAMLFIND_OBJS(pack)=
+    return $(Files $(OCAMLFIND_DESTDIR)/$(pack))