Commits

camlspotter committed 6aff65e

update

Comments (0)

Files changed (4)

         DependPATH($(x))
         export
 
-    $(installed): $(SOURCEPATHS) $(Installed $(REQUIRED_PACKS)) $(REQUIRED_FILES)
+    $(installed): $(SOURCEPATHS) $(Installed ocaml $(REQUIRED_PACKS)) $(REQUIRED_FILES)
         # CR jfuruse: todo: clear _build
 	pwd
         mkdir_if_not_exists($(BUILD_DIR))
 #   Subdirs()
 #
 # It includes "findlib" by default. If you want to build findlib in OMy framework, you have to remove it from the list.
-OCAML_PREINSTALLED_PACKS[]= bigarray camlp4 dbm dynlink graphics num num-top stdlib str threads unix findlib
+OCAML_PREINSTALLED_PACKS[]= bigarray camlp4 dbm dynlink graphics num num-top stdlib str threads unix findlib compiler-libs
 
 # byte/nat
 NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
 OMyOdb(PACK) =
-    $(Installed $(PACK)): 
+    $(Installed $(PACK)):
         ocamlfind remove $(PACK)
         odb $(PACK)
         (cd install-$(PACK); spotinstall $(PACK))
         /bin/rm -rf install-$(PACK)
 
 OMyOasis(PACK, REQUIRED) =
-    $(Installed $(PACK)): $(REQUIRED)
+    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
+        ocamlfind remove $(PACK)
         ocaml setup.ml -configure
         ocaml setup.ml -build
         ocaml setup.ml -reinstall
         ocaml setup.ml -distclean
 
 OMyOasisDir(PACK, DIR, REQUIRED) =
-    $(Installed $(PACK)): $(REQUIRED)
+    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
+        ocamlfind remove $(PACK)
         cd $(DIR); ocaml setup.ml -configure
         cd $(DIR); ocaml setup.ml -build
         cd $(DIR); ocaml setup.ml -uninstall
 
     clean:
 	cd $(DIR); ocaml setup.ml -distclean
+
+OMyOasisArchive(PACK, file, REQUIRED) =
+    dir=
+    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib) $(file)
+        ocamlfind remove $(PACK)
+        section:
+            dir=$(TarAutoExtract $(file), $(dirname $(file)))
+            println(DIR $(dir)) 
+            cd $(dir); ocaml setup.ml -configure
+            cd $(dir); ocaml setup.ml -build
+            cd $(dir); ocaml setup.ml -uninstall
+            cd $(dir); ocaml setup.ml -install
+            cd $(dir); spotinstall $(PACK)
+            CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))
+
+    clean:
+        section:
+            dir=$(TarAutoExtract $(file), $(dirname $(file)))
+            cd $(dir); ocaml setup.ml -distclean
+
+OMyMakeDir(PACK, DIR, REQUIRED) =
+    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
+        ocamlfind remove $(PACK)
+        cd $(DIR); make clean
+        cd $(DIR); make
+        cd $(DIR); make install
+        cd $(DIR); spotinstall $(PACK)
+        CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))
+
+    clean:
+	cd $(DIR); make clean
 
 TarExtractDir(f) =
   files=$(TarList $(f))
-# return $(set $(foreach TopDir, $(files)))
   return $(set $(foreach $(fun x, $(TopDir $(x))), $(files)))
 
 #| Extract tar archive $(f) to directory $(dir).
 TarAutoExtract(f, dir) =
   extdirs = $(TarExtractDir $(f))
   extdir = $(dir)$(DIRSEP)$(if $(eq 1, $(length $(extdirs))), $(nth 0, $(extdirs)), $(rootname $(basename $(f))))
+  atdir = $(if $(eq 1, $(length $(extdirs))), $(dir), $(extdir))
   println(EXTDIR $(extdir))
+  println(ATDIR $(atdir))
+  TarExtractAt($(f), $(atdir))
+  return $(extdir)
 
 # TarAutoExtract($"external/findlib/findlib-1.2.1.tar.gz", $"hoge")