#!/usr/bin/icmake -t.

#include "../../tmp/INSTALL.im"

void yodl(string dest, string src)
{
    system("yodl2man --no-warnings -o " + dest + " " + src);
}

string release = "release.yo";

void rmrelease()
{
    echo(OFF);
    system("rm -f " + release);
    echo(ON);
}

void newReleaseYo()
{
    fprintf << "release.yo" << "SUBST(_CurVers_)(" VERSION ")\n";
    fprintf << "release.yo" << "SUBST(_CurYrs_)(" YEARS ")\n";
}

void main(int argc, list argv)
{
    rmrelease();
    newReleaseYo();
                                    // write the man-pages in ../ (= BASE/doc)
    yodl("../icmake.1", "-r 20000 icmake.yo");  

    yodl("../icmstart.1", "icmstart.yo");
    yodl("../icmbuild.1", "icmbuild.yo");
    yodl("../icmodmap.1", "icmodmap.yo");
    yodl("../icmstart.rc.7", "icmstart.rc.yo");
    yodl("../icmscript.7", "icmscript.yo");
    yodl("../icmconf.7", "icmconf.yo");

    rmrelease();
}






