package/azure-iot-sdk-c: create function for library installation
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 13 Apr 2020 13:17:21 +0000 (15:17 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 13 Apr 2020 13:17:21 +0000 (15:17 +0200)
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>
package/azure-iot-sdk-c/azure-iot-sdk-c.mk

index e6345104eb4447132bd09f1738082dd2a808c02a..6781da41775b4465b52666ced7d029695cb631bb 100644 (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))