pkg = "danga.s2";
srcdir = (subst ".", "/", pkg);
srcs = (glob (join srcdir, "/*.java"));

javac = "javac";
jar = "s2compile.jar";
"all": jar;

jar: srcs;
{
   exec "javac" "-g" "-J-Djava.compiler=NONE" ?;
   exec "jar" "cmf" "manifest.txt" @ "danga";
}

"native":;
{
   exec "gcj-3.0" "-o" "s2native" "--main=danga.s2.s2compile" "s2compile.jar";
}

"clean":;
{
   delete (join srcdir, "/*.class") jar;
}
