From 50c3f9ade9879e6dd0131a2efddcb14f46d920c5 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 14 Apr 2013 01:05:42 +0200 Subject: Rename uninstall* to cleanup* Since cleanup only removes that which will not be restored it makes no sense to call it uninstall. Uninstall should remove everything unconditionally. --- dotfiles.mk | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dotfiles.mk b/dotfiles.mk index b7bd5c6..8ca45fc 100644 --- a/dotfiles.mk +++ b/dotfiles.mk @@ -19,30 +19,30 @@ endef check-objects=$(addprefix check-,$(objects)) install-objects=$(addprefix install-,$(objects)) reverse-objects=$(addprefix reverse-,$(objects)) -uninstall-objects=$(addprefix uninstall-,$(objects)) +cleanup-objects=$(addprefix cleanup-,$(objects)) check-modules=$(addprefix check-,$(modules)) install-modules=$(addprefix install-,$(modules)) reverse-modules=$(addprefix reverse-,$(modules)) -uninstall-modules=$(addprefix uninstall-,$(modules)) +cleanup-modules=$(addprefix cleanup-,$(modules)) -.PHONY: all install uninstall check uninstall $(modules) \ - $(install-objects) $(uninstall-objects) $(check-objects) \ - $(install-modules) $(uninstall-modules) $(check-modules) \ +.PHONY: all install cleanup check cleanup $(modules) \ + $(install-objects) $(cleanup-objects) $(check-objects) \ + $(install-modules) $(cleanup-modules) $(check-modules) \ $(reverse) $(reverse-objects) $(reverse-modules) all: $(modules) $(objects) ifeq ($(MAKEROOT),y) check: $(check-modules) $(check-objects) -install: uninstall $(install-modules) $(install-objects) Makefile.old +install: cleanup $(install-modules) $(install-objects) Makefile.old reverse: $(reverse-modules) $(reverse-objects) ifeq ($(firstword $(MAKEFILE_LIST)),Makefile.old) -uninstall: $(uninstall-modules) $(uninstall-objects) +cleanup: $(cleanup-modules) $(cleanup-objects) @rmdir --ignore-fail-on-non-empty $(DESTDIR) 2> /dev/null || true else -uninstall: export NEWLIST = $(objects) -uninstall: - @$(MAKE) -s -f Makefile.old uninstall +cleanup: export NEWLIST = $(objects) +cleanup: + @$(MAKE) -s -f Makefile.old cleanup Makefile.old: $(firstword $(MAKEFILE_LIST)) @cp "$^" "$@" @@ -58,8 +58,8 @@ install: @$(MAKE) -s -C ../ install reverse: @$(MAKE) -s -C ../ reverse -uninstall: - @$(MAKE) -s -C ../ uninstall +cleanup: + @$(MAKE) -s -C ../ cleanup endif $(modules): %: @@ -84,15 +84,15 @@ $(reverse-objects): reverse-%: $(reverse-modules): reverse-%: @$(MAKE) -s -C $* reverse MKDPREFIX=$(MKDPREFIX)$*/ -$(uninstall-objects): uninstall-%: +$(cleanup-objects): cleanup-%: @$(if $(findstring $*,$(NEWLIST)),, \ @$(if $(call older,$*), \ echo -e "$(FG_RED)+ $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)", \ echo -e "$(FG_GRE)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)"; \ unlink "$(DESTDIR)/$*" || true)) -$(uninstall-modules): uninstall-%: - @$(MAKE) -C $* uninstall MKDPREFIX=$(MKDPREFIX)$*/ +$(cleanup-modules): cleanup-%: + @$(MAKE) -C $* cleanup MKDPREFIX=$(MKDPREFIX)$*/ $(check-objects): check-%: @$(if $(call newer,$*), \ -- cgit v1.2.3-54-g00ecf