blob: 318863ba0a09b24e38037cdacae67f2bcc6c71e1 [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 = " -Oti -Gy -GF -MT ";
var includes = "-IR:/library/vendors/jdk/jdk1.6.0_37/Windows/include "
+ "-IR:/library/vendors/jdk/jdk1.6.0_37/Windows/include/win32";
var libd = Pkg.addLibrary("lib/debug/tcf", targ,
{profile: "debug", suffix: ".lib"});
libd.addObjects(SOURCES);
libd.attrs.incs = includes;
var libr = Pkg.addLibrary("lib/release/tcf", targ,
{profile: "release", suffix: ".lib"});
libr.addObjects(SOURCES);
libr.attrs.incs = includes;
var libdx = Pkg.addLibrary("lib/debug/xs", targ,
{profile: "debug", suffix: ".lib"});
libdx.addObjects(XSSOURCES);
libdx.attrs.incs = includes;
var librx = Pkg.addLibrary("lib/release/xs", targ,
{profile: "release", suffix: ".lib"});
librx.addObjects(XSSOURCES);
librx.attrs.incs = includes;
var prog1 = Pkg.addExecutable("debug/xs", targ, targ.platform,
{profile: "debug", cfgScript: "xs.cfg"});
prog1.addObjects(["xs.c"]);
var prog2 = Pkg.addExecutable("release/xs", targ, targ.platform,
{profile: "release", cfgScript: "xs.cfg"});
prog2.addObjects(["xs.c"]);
/* dlls for use by IAR C-SPY plug-in to call ROV scripts */
targ.$orig.profiles['release'].compileOpts.copts = " -Oti -Gy -GF -MD ";
var tcfdll = Pkg.addLibrary("lib/release/dlls/tcf", targ,
{profile: "release", suffix: ".dll"});
tcfdll.addObjects(SOURCES);
tcfdll.attrs.incs = includes;
var xsdll = Pkg.addLibrary("lib/release/dlls/xs", targ,
{profile: "release", suffix: ".dll"});
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;