blob: aba852a4b21d096d138aec9bbf5af78b78d0f081 [file] [log] [blame]
Pkg.makePrologue = "include custom.mak";
Pkg.otherSrcs = ["tcf.h", "xsapi.h"];
Pkg.otherFiles = [
"tcf.h", "xsapi.h",
"config.jar",
"xs.ksh", "xs-arm.ksh", "xs-mac.ksh",
"tconfini.tcf"
];
var SOURCES = ["tcf.c"];
var XSSOURCES = ["xsapi.c"];
for (var i = 0; i < Build.targets.length; i++) {
var targ = Build.targets[i];
if (targ.os == "MacOS") {
var lib = Pkg.addLibrary("lib/tcf", targ, {profile: "debug"});
lib.attrs.incs = "-I./jdk-include/macos ";
lib.addObjects(SOURCES);
lib.addObjects(XSSOURCES);
var prog = Pkg.addExecutable("xs", targ, targ.platform,
{profile: "debug", cfgScript: "xs.cfg"});
prog.addObjects(["xs"]);
prog.attrs.lopts = "-lm -ldl -lpthread";
}
else if (targ.os == "Linux") {
var lib = Pkg.addLibrary("lib/tcf", targ, {profile: "debug"});
if (targ.isa == "i686") {
lib.attrs.incs = "-I$(TOOLS)/jdk86U/include " +
"-I$(TOOLS)/jdk86U/include/linux";
}
else if (targ.isa == "v7A") {
lib.attrs.incs =
"-I$(TOOLS)/vendors/openjdk/java-1.6.0-openjdk-armhf/include";
}
lib.addObjects(SOURCES);
lib.addObjects(XSSOURCES);
var prog = Pkg.addExecutable("xs", targ, targ.platform,
{profile: "debug", cfgScript: "xs.cfg"});
prog.addObjects(["xs"]);
prog.attrs.lopts = "-lm -ldl -lpthread";
}
else if (targ.os == "Windows") {
/* For Windows, we need to completely clean release.compileOpts.copts
* and add different Object.Attrs because one set of objects has to be
* compiled with -MT and another, for the DLLS, with -MD.
*/
targ.$orig.profiles['release'].compileOpts.copts = "";
var includes = "-IR:/library/vendors/jdk/jdk1.8.0_66/Windows/include "
+ "-IR:/library/vendors/jdk/jdk1.8.0_66/Windows/include/win32";
var libd = Pkg.addLibrary("lib/debug/tcf", targ,
{profile: "debug", suffix: ".lib",
copts: " -Oti -Gy -GF -MTd "});
libd.addObjects(SOURCES);
libd.attrs.incs = includes;
var libr = Pkg.addLibrary("lib/release/tcf", targ,
{profile: "release", suffix: ".lib",
copts: " -Oti -Gy -GF -MT "});
libr.addObjects(SOURCES);
libr.attrs.incs = includes;
var libdx = Pkg.addLibrary("lib/debug/xs", targ,
{profile: "debug", suffix: ".lib",
copts: " -Oti -Gy -GF -MTd "});
libdx.addObjects(XSSOURCES);
libdx.attrs.incs = includes;
var librx = Pkg.addLibrary("lib/release/xs", targ,
{profile: "release", suffix: ".lib",
copts: " -Oti -Gy -GF -MT "});
librx.addObjects(XSSOURCES);
librx.attrs.incs = includes;
var prog1 = Pkg.addExecutable("debug/xs", targ, targ.platform,
{profile: "debug", cfgScript: "xs.cfg",
copts: " -Oti -Gy -GF -MTd "});
prog1.addObjects(["xs.c"]);
var prog2 = Pkg.addExecutable("release/xs", targ, targ.platform,
{profile: "release", cfgScript: "xs.cfg",
copts: " -Oti -Gy -GF -MT "});
prog2.addObjects(["xs.c"]);
/* dlls for use by IAR C-SPY plug-in to call ROV scripts */
var tcfdll = Pkg.addLibrary("lib/release/dlls/tcf", targ,
{profile: "release", suffix: ".dll",
copts: " -Oti -Gy -GF -MD "});
tcfdll.addObjects(SOURCES);
tcfdll.attrs.incs = includes;
var xsdll = Pkg.addLibrary("lib/release/dlls/xs", targ,
{profile: "release", suffix: ".dll",
copts: " -Oti -Gy -GF -MD "});
xsdll.addObjects(XSSOURCES);
xsdll.attrs.incs = includes;
}
else if (targ.os != null) {
print("Warning: xs has not been built for the target: " + targ.name);
}
}
Pkg.attrs.exportExe = true;