install -C $(@D)
endef
+LZ4_DIRS = lib
+
ifeq ($(BR2_PACKAGE_LZ4_PROGS),y)
-LZ4_BUILD_TARGETS = lib lz4
-LZ4_INSTALL_OPTS = install -C $(@D)
-else
-LZ4_BUILD_TARGETS = lib
-LZ4_INSTALL_OPTS = install -C $(@D)/lib
+LZ4_DIRS += programs
endif
define LZ4_BUILD_CMDS
- $(foreach target,$(LZ4_BUILD_TARGETS),\
+ $(foreach dir,$(LZ4_DIRS),\
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
- -C $(@D) $(target)
+ -C $(@D)/$(dir)
)
endef
define LZ4_INSTALL_STAGING_CMDS
- $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
- PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
+ $(foreach dir,$(LZ4_DIRS),\
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
+ PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
+ )
endef
define LZ4_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
- PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
+ $(foreach dir,$(LZ4_DIRS),\
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
+ PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
+ )
endef
$(eval $(generic-package))