1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
void _link(string program)
{
exec(COMPILER, "-o", g_install + BIN + "/" + program,
g_wip + "/" + program + "/*.o",
"-L" + g_wip, "-lyodl", g_lopt);
}
void _buildProgram(string program)
{
std_cpp(g_wip + "/" + program, 0, program, "");
_link(program);
}
void _programYodl()
{
buildBuiltins();
_buildProgram("yodl");
}
void _programYodlpost()
{
_buildProgram("yodlpost");
}
void _programYodlverbinsert()
{
string strip;
if (strfind(g_lopt, "-s") != -1)
strip = "-s";
chdir("verbinsert");
system("icmbuild");
chdir("..");
system("install " + strip + " verbinsert/tmp/bin/binary " +
g_install + BIN + "/yodlverbinsert");
}
void program(string target)
{
md(g_install + BIN);
if (target == "programs" || target == "yodlstriproff")
run("cp scripts/yodlstriproff " + g_install + BIN);
if (target == "programs" || target == "yodl2whatever")
run("scripts/configreplacements " +
"scripts/yodl2whatever.in " +
g_install + BIN + "/yodl2whatever " +
g_install);
if (target == "programs" || target == "yodlverbinsert")
_programYodlverbinsert();
if (
target == "yodlstriproff"
||
target == "yodl2whatever"
||
target == "yodlverbinsert"
)
return;
compileRSS(); // ./compilerss
if (target == "programs" || target == "yodl")
_programYodl();
if (target == "programs" || target == "yodlpost")
_programYodlpost();
}
void programExit(string target, string strip) // build one program,
{ // called from main
#ifndef PROFILING
if (strip == "strip")
g_lopt = "-s";
#endif
program(target);
exit(0);
}
void programsExit(string strip) // build all programs,
{ // called from main
#ifndef PROFILING
if (strip == "strip")
g_lopt = "-s";
#endif
program("programs");
exit(0);
}
|