package/lz4: simplify build/install logic

No functional change.

Rather than tracking both build targets and sub directory to run 'make
install' from, use a make loop for the staging/target install logic, similar
to how we are doing it to for the build step and directly use the Makefile
in the sub directory rather than the helper lib/lz4 targets in the top level
Makefile.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Peter Korsgaard
2020-07-27 18:20:07 +02:00
committed by Yann E. MORIN
parent 38bcaecb67
commit df71536518

View File

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