forked from pyrite-dev/pmake
support for rc
This commit is contained in:
parent
9520be0be0
commit
05dff81025
3 changed files with 12 additions and 3 deletions
|
|
@ -20,7 +20,9 @@ Watcom.compile = function(target, obj, src) {
|
||||||
const includes = pmake.includes(target).map(add_i).join(" ");
|
const includes = pmake.includes(target).map(add_i).join(" ");
|
||||||
const flags = "-bt=nt -fr= -q " + includes + " -fo=" + obj + " " + src;
|
const flags = "-bt=nt -fr= -q " + includes + " -fo=" + obj + " " + src;
|
||||||
|
|
||||||
if(src.endsWith(".c")) {
|
if(src.endsWith(".rc")){
|
||||||
|
return "wrc -bt=nt -r -fo=" + obj + " " + src;
|
||||||
|
}else if(src.endsWith(".c")) {
|
||||||
return "wcc386 " + flags;
|
return "wcc386 " + flags;
|
||||||
} else {
|
} else {
|
||||||
return "wpp386 " + flags;
|
return "wpp386 " + flags;
|
||||||
|
|
@ -33,6 +35,7 @@ Watcom.link = function(target, files) {
|
||||||
return "wlib -q -b -n -fo " + this.output(target) + " " + files.join(" ");
|
return "wlib -q -b -n -fo " + this.output(target) + " " + files.join(" ");
|
||||||
} else if(target instanceof pmake.ExecutableProject) {
|
} else if(target instanceof pmake.ExecutableProject) {
|
||||||
function add_file(x) {
|
function add_file(x) {
|
||||||
|
if(x.endsWith(".res")) return "option resource=" + x;
|
||||||
return "file \"" + x + "\"";
|
return "file \"" + x + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,9 @@ function make(output) {
|
||||||
|
|
||||||
for(var i = 0; i < objs.length; i++) {
|
for(var i = 0; i < objs.length; i++) {
|
||||||
var usage = "";
|
var usage = "";
|
||||||
if(pmake.isCxx(self.sources[i])) {
|
if(self.sources[i].endswith(".rc")){
|
||||||
|
usage = "RC";
|
||||||
|
}else if(pmake.isCxx(self.sources[i])) {
|
||||||
usage = "CXX";
|
usage = "CXX";
|
||||||
} else {
|
} else {
|
||||||
usage = "CC";
|
usage = "CC";
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,7 @@ Compiler.prototype.init = function() {
|
||||||
Compiler.prototype.output = function(target) {
|
Compiler.prototype.output = function(target) {
|
||||||
if((typeof target) == "string") {
|
if((typeof target) == "string") {
|
||||||
if(target.endsWith(".c")) return target.replace(/\.c$/, ".o");
|
if(target.endsWith(".c")) return target.replace(/\.c$/, ".o");
|
||||||
|
if(target.endsWith(".rc")) return target.replace(/\.rc$/, ".res");
|
||||||
} else if(target instanceof pmake.LibraryProject) {
|
} else if(target instanceof pmake.LibraryProject) {
|
||||||
return "lib" + target.output + ".a";
|
return "lib" + target.output + ".a";
|
||||||
} else if(target instanceof pmake.ExecutableProject) {
|
} else if(target instanceof pmake.ExecutableProject) {
|
||||||
|
|
@ -207,6 +208,7 @@ const POSIXCompiler = pmake.inherit(Compiler, function(target) {
|
||||||
this.ar = "ar";
|
this.ar = "ar";
|
||||||
this.cc = "cc";
|
this.cc = "cc";
|
||||||
this.cxx = "c++";
|
this.cxx = "c++";
|
||||||
|
this.rc = "windres";
|
||||||
});
|
});
|
||||||
|
|
||||||
POSIXCompiler.prototype.compile = function(target, obj, src) {
|
POSIXCompiler.prototype.compile = function(target, obj, src) {
|
||||||
|
|
@ -217,7 +219,9 @@ POSIXCompiler.prototype.compile = function(target, obj, src) {
|
||||||
const includes = pmake.includes(target).map(add_i).join(" ");
|
const includes = pmake.includes(target).map(add_i).join(" ");
|
||||||
const flags = includes + " -c -o " + obj + " " + src;
|
const flags = includes + " -c -o " + obj + " " + src;
|
||||||
|
|
||||||
if(src.endsWith(".c")) {
|
if(src.endsWith(".rc")){
|
||||||
|
return this.prefix + this.rc + " -O coff " + src + " " + obj;
|
||||||
|
}else if(src.endsWith(".c")) {
|
||||||
return this.prefix + this.cc + " " + flags;
|
return this.prefix + this.cc + " " + flags;
|
||||||
} else if(is_cxx(src)) {
|
} else if(is_cxx(src)) {
|
||||||
return this.prefix + this.cxx + " " + flags;
|
return this.prefix + this.cxx + " " + flags;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue