| 1 |
// base is the base location of the macros to build. |
| 2 |
// include path is the location where to find the macros |
| 3 |
// this should be ./ (local use, for man, manual) or STD_INCLUDE |
| 4 |
// |
| 5 |
// void buildMacros(string base, string includePath) |
| 6 |
|
| 7 |
void _configReplacements(string source, string base, string includePath) |
| 8 |
{ |
| 9 |
source = change_ext(source, ""); |
| 10 |
|
| 11 |
run("scripts/configreplacements " + |
| 12 |
"macros/in/" + source + ".in " + |
| 13 |
base + source + ".yo " + |
| 14 |
includePath); |
| 15 |
} |
| 16 |
|
| 17 |
void _stdMacros(string base, string includePath) |
| 18 |
{ |
| 19 |
list std; |
| 20 |
int idx; |
| 21 |
string conversion; |
| 22 |
|
| 23 |
std = strtok(STD_CONVERSIONS, " "); // the list of format-conversions |
| 24 |
|
| 25 |
// Create the std.<format>.yo files, providing scratch filename, |
| 26 |
// destination directory, requested format, and STD_INCLUDE path |
| 27 |
for (idx = listlen(std); idx--; ) |
| 28 |
run("scripts/stdmacros " + |
| 29 |
g_wip + "/scratch " + |
| 30 |
base + " " + |
| 31 |
std[idx] + " " + |
| 32 |
includePath); |
| 33 |
} |
| 34 |
|
| 35 |
// base is the base location of the macros to build. |
| 36 |
// include path is the location where to find the macros |
| 37 |
// this should be ./ (local use, for man, manual) or STD_INCLUDE |
| 38 |
void buildMacros(string base, string includePath) |
| 39 |
{ |
| 40 |
list in; |
| 41 |
int idx; |
| 42 |
|
| 43 |
md(base); |
| 44 |
base += "/"; |
| 45 |
|
| 46 |
run("rm -rf " + base + "*"); // remove old build-location |
| 47 |
|
| 48 |
chdir("macros/in"); // location of the format-specific macro |
| 49 |
in = makelist("*.in"); // files, like html.yo |
| 50 |
chdir(g_cwd); |
| 51 |
|
| 52 |
for (idx = listlen(in); idx--; ) // set the config.h info and create the |
| 53 |
_configReplacements(in[idx], base, includePath); // format-specific |
| 54 |
// files |
| 55 |
|
| 56 |
_stdMacros(base, includePath); // create the std.<format>.yo files, |
| 57 |
// like std.man.yo |
| 58 |
|
| 59 |
run("cp -r macros/yodl/* " + base); // install chartables, xlatin1.tex |
| 60 |
// and xml/ files |
| 61 |
} |