mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Clean up and make the Makefile a bit more intelligent
This commit is contained in:
66
Makefile
66
Makefile
@@ -1,56 +1,52 @@
|
||||
.SILENT:
|
||||
#
|
||||
# Default target.
|
||||
#
|
||||
|
||||
default: vendor
|
||||
|
||||
|
||||
#
|
||||
# Main targets
|
||||
#
|
||||
|
||||
.PHONY: backup-elpa
|
||||
backup-elpa:
|
||||
tar -cjf elpa_$(shell date "+%Y-%m-%d").tar.bz2 elpa
|
||||
|
||||
.PHONY: vendor
|
||||
vendor: \
|
||||
vendor/dired+.el \
|
||||
vendor/escreen.el \
|
||||
vendor/hideshowvis.el \
|
||||
vendor/linum+.el \
|
||||
vendor/rubocopfmt.el \
|
||||
vendor/tomorrow-night-paradise-theme.el
|
||||
|
||||
.PHONY: update_vendor
|
||||
update_vendor: \
|
||||
update_vendor/dired+.el \
|
||||
update_vendor/escreen.el \
|
||||
update_vendor/hideshowvis.el \
|
||||
update_vendor/linum+.el \
|
||||
update_vendor/rubocopfmt.el \
|
||||
update_vendor/tomorrow-night-paradise-theme.el
|
||||
|
||||
#
|
||||
# Internals
|
||||
# Functions.
|
||||
#
|
||||
|
||||
define vendored
|
||||
VENDORED = $(VENDORED) $(1)
|
||||
|
||||
.SILENT: $(1)
|
||||
$(1):
|
||||
echo "fetching $(1)..." && curl -s -L -o "$(1)" "$(2)"
|
||||
|
||||
.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
|
||||
|
||||
|
||||
#
|
||||
# Specify vendor targets
|
||||
# Defined vendored dependencies.
|
||||
#
|
||||
|
||||
$(eval $(call vendored,vendor/dired+.el,"https://www.emacswiki.org/emacs/download/dired%2b.el"))
|
||||
$(eval $(call vendored,vendor/escreen.el,"https://github.com/renard/escreen-el/raw/master/escreen.el"))
|
||||
$(eval $(call vendored,vendor/hideshowvis.el,"https://www.emacswiki.org/emacs/download/hideshowvis.el"))
|
||||
$(eval $(call vendored,vendor/linum+.el,"http://www.emacswiki.org/emacs/download/linum%2b.el"))
|
||||
$(eval $(call vendored,vendor/rubocopfmt.el,"https://github.com/jimeh/rubocopfmt.el/raw/master/rubocopfmt.el"))
|
||||
$(eval $(call vendored,vendor/tomorrow-night-paradise-theme.el,"https://github.com/jimeh/tomorrow-night-paradise-theme.el/raw/master/tomorrow-night-paradise-theme.el"))
|
||||
$(eval $(call vendored,vendor/dired+.el,https://www.emacswiki.org/emacs/download/dired%2b.el))
|
||||
$(eval $(call vendored,vendor/escreen.el,https://github.com/renard/escreen-el/raw/master/escreen.el))
|
||||
$(eval $(call vendored,vendor/hideshowvis.el,https://www.emacswiki.org/emacs/download/hideshowvis.el))
|
||||
$(eval $(call vendored,vendor/linum+.el,http://www.emacswiki.org/emacs/download/linum%2b.el))
|
||||
$(eval $(call vendored,vendor/rubocopfmt.el,https://github.com/jimeh/rubocopfmt.el/raw/master/rubocopfmt.el))
|
||||
$(eval $(call vendored,vendor/tomorrow-night-paradise-theme.el,https://github.com/jimeh/tomorrow-night-paradise-theme.el/raw/master/tomorrow-night-paradise-theme.el))
|
||||
|
||||
|
||||
#
|
||||
# Main targets.
|
||||
#
|
||||
|
||||
vendor: $(VENDORED)
|
||||
update_vendor: $(foreach file,$(VENDORED),update_$(file))
|
||||
remove_vendor: $(foreach file,$(VENDORED),remove_$(file))
|
||||
|
||||
.PHONY: backup-elpa
|
||||
backup-elpa:
|
||||
tar -cjf elpa_$(shell date "+%Y-%m-%d").tar.bz2 elpa
|
||||
|
||||
Reference in New Issue
Block a user