Files
.emacs.d/Makefile
Jim Myhrberg 160d920c3a chore(makefile): remove backup-elpa target
It is no longer relevant or needed as I use straight.el to install
packages now, which supports locking packages to specific versions.

This backup target was essentially a way of being able to re-produce a
specific set of exact dependencies in case updating packages caused
issues.
2021-04-07 23:50:11 +01:00

51 lines
926 B
Makefile

#
# Default target.
#
default: vendor
.PHONY: new-version
new-version:
$(if $(shell which npx),,\
$(error No npx found in PATH, please install NodeJS))
npx standard-version
#
# Functions.
#
define vendored
VENDORED += $(1)
.SILENT: $(1)
$(1):
echo "fetching $(1)..." && \
mkdir -p "$(dir $(1))" && \
curl -s -L -o "$(1)" "$(2)" && \
([[ "$(1)" == "bin/"* ]] && chmod +x "$(1)") || exit 0
.PHONY: remove_$(1)
.SILENT: remove_$(1)
remove_$(1):
(test -f "$(1)" && rm "$(1)" && echo "removed $(1)") || exit 0
.PHONY: update_$(1)
.SILENT: update_$(1)
update_$(1): remove_$(1) $(1)
endef
#
# Defined vendored dependencies.
#
$(eval $(call vendored,bin/rubocop-daemon-wrapper,https://github.com/fohte/rubocop-daemon/raw/master/bin/rubocop-daemon-wrapper))
#
# Main targets.
#
vendor: $(VENDORED)
update_vendor: $(foreach file,$(VENDORED),update_$(file))
remove_vendor: $(foreach file,$(VENDORED),remove_$(file))