james woodyatt avatar james woodyatt committed e21d5f4

Add the Iom library to the package.

Comments (0)

Files changed (3)

 export PKG
 
 ### Subdirectories
-.SUBDIRS: cf nx
+.SUBDIRS: cf nx iom
+#iom
 
 ### Compose package
 section
             raise $x
         this.NAME=$(src.NAME)
         this.COMPONENTS[]=
-        if $(defined src.COMPONENTS)
-            private.c=$(src.COMPONENTS)
-            c=$(foreach $(fun c, $(Component.assert $c, $(context))), $c)
-            this.COMPONENTS=$c
+        if $(src.object-mem COMPONENTS)
+            private.cs=$(src.COMPONENTS)
+            foreach(c, $(cs))
+                Component.assert($c, $(context))
+            this.COMPONENTS=$(cs)
             export
         return $(this)
 

project/lang/OCaml.om

     CFLAGS=-fPIC -Wall
     
     ### The verbose flag
-    protected.verbose-flag()=
+    verbose-flag()=
         return $(if $(VERBOSE), -verbose, $(EMPTY))
     
     ### Dependency scanner command driver
         srcfiles=$(file $(srcfiles))
         dst=$(dir $(dst))
         this.DEPEND+=$(dst)
-        obj=
-        export obj
+        cmo=
+        export cmo
         foreach(i, $(srcfiles))
             o=$(addprefix $(dst)/, $(replace-extension .cmo, $(basename $i)))
             o=$(file $o)
             s=$(ocaml-scanner-rule $i, $o)
             scanning-composer-rule($i, $o, $s)
-            obj+= $o
-        return $(obj)
+            cmo+= $o
+        return $(cmo)
+    
+    ### Compose native compiled library file in staging directory
+    cma-file(name, cmofiles, dst)=
+        dst=$(dir $(dst))
+        this.DEPEND+=$(dst)
+        private.cma=$(file $(dst)/$(name).cma)
+        this.composer-options(i, o)=
+            return -a $(include-search) -o $o $i
+        composer-rule($(cmofiles), $(cma))
+        return $(cma)
 
 ### The OCaml native compiler
 OCAMLOPT.=
     
     ### Compose native compiled module files in staging directory
     cmx-files(srcfiles, dst)=
-        cmx=$(file $(srcfiles))
+        srcfiles=$(file $(srcfiles))
         dst=$(dir $(dst))
         this.DEPEND+=$(dst)
-        obj=
-        export obj
+        cmx=
+        export cmx
         foreach(i, $(srcfiles))
-            o=$(addprefix $(dst)/, $(replace-extension .cmx, $(basename $i)))
-            o=$(file $o)
+            private.o=$(replace-extension .cmx, $(basename $i))
+            o=$(file $(addprefix $(dst)/, $o))
             s=$(ocaml-scanner-rule $i, $o)
             cmx-composer-rule($i, $o, $s)
-            obj+= $o
-        return $(obj)
+            cmx+= $o
+        return $(cmx)
+    
+    ### Compose native compiled library file in staging directory
+    native-library(name, cmxfiles, dst)=
+        dst=$(dir $(dst))
+        this.DEPEND+=$(dst)
+        private.cmxa=$(file $(dst)/$(name).cmxa)
+        private.a=$(replacesuffixes .cmxa, .a, $(cmxa))
+        this.composer-options(i, o)=
+            return -a $(include-search) $(verbose-flag) -o $(cmxa) $i
+        composer-rule($(cmxfiles), $(cmxa) $a)
+        return $(cmxa) $a
 
 ### The OCaml library compiler driver
 OCAMLMKLIB.=
     
     ### Auxillary composition method
     protected.compose-aux(config, cmo, cmx, dst)=
+        private.cc=$(this.OCAMLC)
+        private.ccopt=$(this.OCAMLOPT)
         private.outputs=
-        private.olibs=
-        private.clibs=
-        export clibs outputs
+        export outputs
         if $(this.CFILES)
-            private.po=$(this.OCAMLC.c-primitives $(this.CFILES), $(dst))
-            clibs=$(this.OCAMLMKLIB.c-library $(this.NAME), $(po), $(dst))
-            outputs+=$(clibs)
-        olibs=$(this.OCAMLMKLIB.byte-library $(this.NAME), $(cmo), $(dst))
-        $(olibs): $(clibs)
-        outputs+=$(olibs)
-        olibs=$(this.OCAMLMKLIB.native-library $(this.NAME), $(cmx), $(dst))
-        $(olibs): $(clibs)
-        outputs+=$(olibs)
+            private.mklib=$(this.OCAMLMKLIB)
+            private.libs=
+            private.po=$(ccopt.c-primitives $(this.CFILES), $(dst))
+            private.pa=$(mklib.c-library $(this.NAME), $(po), $(dst))
+            outputs+=$(pa)
+            libs=$(mklib.byte-library $(this.NAME), $(cmo), $(dst))
+            $(libs): $(pa)
+            outputs+=$(libs)
+            libs=$(mklib.native-library $(this.NAME), $(cmx), $(dst))
+            $(libs): $(pa)
+            outputs+=$(libs)
+        else
+            outputs+=$(cc.cma-file $(this.NAME), $(cmo), $(dst))
+            outputs+=$(ccopt.native-library $(this.NAME), $(cmx), $(dst))
         return $(outputs)
     
     ### Construct a new composer
         private.programs=
         export programs
         section
-            cc=$(this.OCAMLC)
+            private.cc=$(this.OCAMLC)
+            cc.OPTIONS+=$(cc.verbose-flag)
             cc.DEPEND+=$(cma)
             cc.SEARCH+=$(load)
             objs=$(cma) $(cmo)
             name=$(this.NAME).run
             programs+=$(cc.program $(name), $(config), $(objs), $(dst))
         section
-            cc=$(this.OCAMLOPT)
+            private.cc=$(this.OCAMLOPT)
+            cc.OPTIONS+=$(cc.verbose-flag)
             cc.DEPEND+=$(cmxa)
             cc.SEARCH+=$(load)
             objs=$(cmxa) $(cmx)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.