Commit 6094b643 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

nmk: build.mk -- Add @libso-y helper

To link dynamic libs (libcompel for example).
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 4a19618e
...@@ -16,6 +16,7 @@ ld_flags := ...@@ -16,6 +16,7 @@ ld_flags :=
cleanup-y := cleanup-y :=
mrproper-y := mrproper-y :=
objdirs := objdirs :=
libso-y :=
MAKECMDGOALS := $(call uniq,$(MAKECMDGOALS)) MAKECMDGOALS := $(call uniq,$(MAKECMDGOALS))
...@@ -219,6 +220,17 @@ cleanup-y += $(obj)/$(1) ...@@ -219,6 +220,17 @@ cleanup-y += $(obj)/$(1)
endef endef
$(foreach t,$(hostprogs-y),$(eval $(call gen-host-rules,$(t)))) $(foreach t,$(hostprogs-y),$(eval $(call gen-host-rules,$(t))))
#
# Dynamic library linking.
define gen-so-link-rules
$(call objectify,$(1)).so: $(call objectify,$($(1)-objs)) $(src-makefile)
$$(call msg-link, $$@)
$$(Q) $$(CC) -shared $$(ldflags-so) $$(LDFLAGS) $$(LDFLAGS_$$(@F)) -o $$@ $(call objectify,$($(1)-objs))
all-y += $(call objectify,$(1)).so
cleanup-y += $(call objectify,$(1)).so
endef
$(foreach t,$(libso-y),$(eval $(call gen-so-link-rules,$(t))))
# #
# Figure out if the target we're building needs deps to include. # Figure out if the target we're building needs deps to include.
define collect-deps define collect-deps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment