Debian Codegraph @

icmake/program

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