aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/libraries.mk5
-rw-r--r--mk/programs.mk4
2 files changed, 6 insertions, 3 deletions
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 6541775f3..02e4d47f9 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -67,6 +67,7 @@ define build-library
$(1)_LDFLAGS_USE :=
$(1)_LDFLAGS_USE_INSTALLED :=
+ $(1)_LIB_CLOSURE := $(1)
$$(eval $$(call create-dir, $$(_d)))
@@ -128,10 +129,12 @@ define build-library
+$$(trace-ld) $(LD) -Ur -o $$(_d)/$$($(1)_NAME).o $$^
$$(trace-ar) $(AR) crs $$@ $$(_d)/$$($(1)_NAME).o
- $(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)
+ $(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
$(1)_INSTALL_PATH := $$(libdir)/$$($(1)_NAME).a
+ $(1)_LIB_CLOSURE += $$($(1)_LIBS)
+
endif
$(1)_LDFLAGS_USE += $$($(1)_LDFLAGS_PROPAGATED)
diff --git a/mk/programs.mk b/mk/programs.mk
index 204409332..1ee1d3fa5 100644
--- a/mk/programs.mk
+++ b/mk/programs.mk
@@ -30,7 +30,7 @@ define build-program
_d := $(buildprefix)$$($(1)_DIR)
_srcs := $$(sort $$(foreach src, $$($(1)_SOURCES), $$(src)))
$(1)_OBJS := $$(addprefix $(buildprefix), $$(addsuffix .o, $$(basename $$(_srcs))))
- _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
+ _libs := $$(foreach lib, $$($(1)_LIBS), $$(foreach lib2, $$($$(lib)_LIB_CLOSURE), $$($$(lib2)_PATH)))
$(1)_PATH := $$(_d)/$$($(1)_NAME)
$$(eval $$(call create-dir, $$(_d)))
@@ -58,7 +58,7 @@ define build-program
else
$(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_PATH) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
- install -t $(DESTDIR)$$($(1)_INSTALL_DIR) $$<
+ +$$(trace-install) install -t $(DESTDIR)$$($(1)_INSTALL_DIR) $$<
endif
endif