From 4437941405225ea2d595568d1067b464adba3599 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 10 May 2026 05:00:24 +0900 Subject: [PATCH] stuff --- src/js/cmdline.js | 3 ++- src/js/core.js | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/cmdline.js b/src/js/cmdline.js index 24f83fc..fda5d4a 100644 --- a/src/js/cmdline.js +++ b/src/js/cmdline.js @@ -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) { diff --git a/src/js/core.js b/src/js/core.js index 374431f..7cf4000 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -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") {