.PHONY: help update backup PLUGINS := $(wildcard bundle/*) LIST := download-plugins.sh ## Some local functions upd = $(shell git -C $1 pull) bak = $(shell echo "git clone $$(git -C $1 remote get-url origin) $1" >> $2) help: ## Display this message @echo "Usage:" @sed -nE "s|^(.+?)\\s*:\\s*##\\s*(.+)$$|\\tmake \\1\\t- \\2|p" \ $(lastword $(MAKEFILE_LIST)) update: ## Update all bundled plugins @echo $(foreach dir,$(PLUGINS),$(call upd,$(dir))) > /dev/null backup: ## Create backup list of bundled plugins @echo $(foreach dir,$(PLUGINS),$(call bak,$(dir),$(LIST))) @cat $(LIST)