Source

omy / OMyOasis

Full commit
OMyOdb(PACK) =
    $(Installed $(PACK)):
        ocamlfind remove $(PACK)
        odb $(PACK)
        (cd install-$(PACK); spotinstall $(PACK))
        CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))

    clean:
        /bin/rm -rf install-$(PACK)

OMyOasis(PACK, REQUIRED) =
    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
        ocamlfind remove $(PACK)
        ocaml setup.ml -configure
        ocaml setup.ml -build
        ocaml setup.ml -reinstall
        spotinstall $(PACK)
        CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))

    clean:
        ocaml setup.ml -distclean
	# CR jfuruse: we cannot trust distclean... for ex, curl's distclean does NOTHING!  

OMyOasisDir(PACK, DIR, REQUIRED) =
    $(Installed $(PACK)): $(REQUIRED) $(Installed findlib)
        ocamlfind remove $(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)
        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)
        /bin/rm -rf _build
        /bin/cp -a $(DIR) _build
        cd _build; make clean
        cd _build; make
        cd _build; make install
        cd _build; spotinstall $(PACK)
        CreateInstalled($(PACK), $(find $(OCAMLFIND_DESTDIR)$(DIRSEP)$(PACK) -f {}))

    clean:
	/bin/rm -rf _build