works for gcc

This commit is contained in:
Nishi 2026-05-09 16:39:35 +09:00
commit f5e4e6990b
Signed by: nishi
GPG key ID: 27EF69B208EB9343
3 changed files with 45 additions and 11 deletions

View file

@ -146,20 +146,19 @@ POSIXCompiler.prototype.compile = function(target, obj, src) {
return "-I" + x;
}
const includes = pmake.includes(target).map(add_i)
if(includes.length > 0) includes = " " + includes.join(" ");
const includes = pmake.includes(target).map(add_i).join(" ");
const flags = includes + " -c -o " + obj + " " + src;
if(src.endsWith(".c")) {
return this.prefix + this.cc + includes + " -c -o " + obj + " " + src;
return this.prefix + this.cc + " " + flags;
} else if(is_cxx(src)) {
return this.prefix + this.cxx + includes + " -c -o " + obj + " " + src;
return this.prefix + this.cxx + " " + flags;
}
return "";
}
};
POSIXCompiler.prototype.link = function(target, files) {
POSIXCompiler.prototype.link = function(target, files) {
if(target instanceof pmake.LibraryProject) {
return this.prefix + this.ar + " rcs " + this.output(target) + " " + files.join(" ");
} else if(target instanceof pmake.ExecutableProject) {