package/azure-iot-sdk-c: create function for library installation

As a preparation for adding the creation of some symlinks, let's
factor the library installation into a function.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Thomas Petazzoni 2020-04-13 15:17:21 +02:00
parent 59de11b047
commit 43822bb6db

View File

@ -44,18 +44,20 @@ AZURE_IOT_SDK_C_LIBS += \
umqtt/libumqtt.so
endif
define AZURE_IOT_SDK_C_INSTALL_STAGING_CMDS
define AZURE_IOT_SDK_C_INSTALL_LIBS
$(foreach l,$(AZURE_IOT_SDK_C_LIBS), \
$(INSTALL) -D -m 0755 $(@D)/$(l) $(STAGING_DIR)/usr/lib/$(notdir $(l))
$(INSTALL) -D -m 0755 $(@D)/$(l) $(1)/usr/lib/$(notdir $(l))
)
endef
define AZURE_IOT_SDK_C_INSTALL_STAGING_CMDS
$(call AZURE_IOT_SDK_C_INSTALL_LIBS,$(STAGING_DIR))
cp -a $(@D)/c-utility/inc/* $(STAGING_DIR)/usr/include/
cp -a $(@D)/iothub_client/inc/* $(STAGING_DIR)/usr/include/
endef
define AZURE_IOT_SDK_C_INSTALL_TARGET_CMDS
$(foreach l,$(AZURE_IOT_SDK_C_LIBS), \
$(INSTALL) -D -m 0755 $(@D)/$(l) $(TARGET_DIR)/usr/lib/$(notdir $(l))
)
$(call AZURE_IOT_SDK_C_INSTALL_LIBS,$(TARGET_DIR))
endef
$(eval $(cmake-package))