Skip to content

Commit

Permalink
mk: Fix installation of static libraries
Browse files Browse the repository at this point in the history
Fixes NixOS#7021.
  • Loading branch information
zhaofengli committed Jan 6, 2023
1 parent 8c52f8e commit 83cd142
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mk/libraries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ define build-library

$(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)

$(1)_INSTALL_PATH := $$(libdir)/$$($(1)_NAME).a
$(1)_INSTALL_PATH := $(DESTDIR)$$($(1)_INSTALL_DIR)/$$($(1)_NAME).a

$$(eval $$(call create-dir, $$($(1)_INSTALL_DIR)))

$$($(1)_INSTALL_PATH): $$($(1)_OBJS) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
+$$(trace-ld) $(LD) -Ur -o $$(_d)/$$($(1)_NAME).o $$^
$$(trace-ar) $(AR) crs $$@ $$(_d)/$$($(1)_NAME).o

install: $$($(1)_INSTALL_PATH)

endif

Expand Down

0 comments on commit 83cd142

Please sign in to comment.