Commits

camlspotter  committed 449c21f

no longer trust ocaml setup.ml -clean

  • Participants
  • Parent commits 2718e16

Comments (0)

Files changed (1)

 OMyOasisDir(PACK, DIR, 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
-        cd $(DIR); ocaml setup.ml -install
-        cd $(DIR); spotinstall $(PACK)
+        # Never trust setup.ml. It does NOT clean things correctly sometimes!
+        /bin/rm -rf _build
+        /bin/cp -a $(DIR) _build
+        cd _build; ocaml setup.ml -configure --prefix $(PREFIX)
+        cd _build; ocaml setup.ml -build
+        cd _build; ocaml setup.ml -uninstall
+        cd _build; ocaml setup.ml -install
+        cd _build; spotinstall $(PACK)
         CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))
 
     clean:
 	cd $(DIR); ocaml setup.ml -distclean
 
+OMyOasisProgram(PACK, DIR, REQUIRED, PRODUCED) =
+    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
+        # Never trust setup.ml. It does NOT clean things correctly sometimes!
+        /bin/rm -rf _build
+        /bin/cp -a $(DIR) _build
+        cd _build; ocaml setup.ml -configure --prefix $(PREFIX)
+        cd _build; ocaml setup.ml -build
+        cd _build; ocaml setup.ml -uninstall
+        cd _build; ocaml setup.ml -install
+        CreateInstalled($(PACK), $(PRODUCED))
+
+    clean:
+	cd $(DIR); ocaml setup.ml -distclean
+
 OMyOasisArchive(PACK, file, REQUIRED) =
     dir=
     $(Installed $(PACK)): $(REQUIRED) $(Installed findlib) $(file)