This commit is contained in:
Nishi 2026-05-10 05:00:24 +09:00
commit 4437941405
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 11 additions and 2 deletions

View file

@ -140,6 +140,7 @@ function make(output) {
const self = targets.filter(target_filter)[0];
const objs = self.sources.map(pmake.compiler.output);
const libs = pmake.libs(self).join(" ");
mk.write("\n");
@ -147,7 +148,7 @@ function make(output) {
mk.write(" @$(NOP)\n");
mk.write("\n");
mk.write(pmake.compiler.output(self) + ": " + objs.join(" ") + "\n");
mk.write(pmake.compiler.output(self) + ": " + objs.join(" ") + " " + libs + "\n");
if(!(self instanceof pmake.InterfaceProject)) {
var usage = "";
if(self instanceof pmake.LibraryProject) {

View file

@ -136,7 +136,15 @@ pmake.libdirs = function(target) {
pmake.libs = function(target, if_str) {
function libs(x) {
if(x instanceof pmake.LibraryProject) {
const r = pmake.resolveProjects(x.libraries, if_str).concat([ x.base + "/" + pmake.compiler.output(x) ]);
function recursion(x) {
if(x instanceof pmake.LibraryProject) {
return pmake.libs(x, if_str);
} else {
return [ x ];
}
}
const r = x.libraries.map(recursion).flat().concat([ x.base + "/" + pmake.compiler.output(x) ]);
return r;
} else if((typeof x) == "string") {