[Buildroot] [PATCH 3/4] package/vim: refactor install target logic

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Dec 23 18:10:10 UTC 2025


Instead of calling $(MAKE) multiple times, let's call it once, with
all installation targets needed. We introduce a VIM_INSTALL_TARGETS
variable to collect the list of make install targets that need to be
invoked.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 package/vim/vim.mk | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/package/vim/vim.mk b/package/vim/vim.mk
index 10ff3a109b..a1a484c673 100644
--- a/package/vim/vim.mk
+++ b/package/vim/vim.mk
@@ -46,17 +46,18 @@ else
 VIM_CONF_OPTS += --disable-selinux
 endif
 
+VIM_INSTALL_TARGETS = \
+	installvimbin installpack \
+	installtools installlinks
+
+ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
+VIM_INSTALL_TARGETS += installrtbase installmacros
+endif
+
 define VIM_INSTALL_TARGET_CMDS
 	$(RM) -f $(TARGET_DIR)/usr/bin/{ex,view,rvim,rview,vimdiff}
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installvimbin
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installpack
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installtools
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installlinks
-endef
-
-define VIM_INSTALL_RUNTIME_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installrtbase
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) installmacros
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) \
+		$(VIM_INSTALL_TARGETS)
 endef
 
 define VIM_REMOVE_DOCS
@@ -77,7 +78,6 @@ endif
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
 
 ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
-VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_RUNTIME_CMDS
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_REMOVE_DOCS
 endif
 
-- 
2.52.0



More information about the buildroot mailing list