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.
This commit is contained in:
Tom Willemse 2013-04-14 01:05:42 +02:00
parent d8aa1d0ed1
commit 50c3f9ade9

View file

@ -19,30 +19,30 @@ endef
check-objects=$(addprefix check-,$(objects)) check-objects=$(addprefix check-,$(objects))
install-objects=$(addprefix install-,$(objects)) install-objects=$(addprefix install-,$(objects))
reverse-objects=$(addprefix reverse-,$(objects)) reverse-objects=$(addprefix reverse-,$(objects))
uninstall-objects=$(addprefix uninstall-,$(objects)) cleanup-objects=$(addprefix cleanup-,$(objects))
check-modules=$(addprefix check-,$(modules)) check-modules=$(addprefix check-,$(modules))
install-modules=$(addprefix install-,$(modules)) install-modules=$(addprefix install-,$(modules))
reverse-modules=$(addprefix reverse-,$(modules)) reverse-modules=$(addprefix reverse-,$(modules))
uninstall-modules=$(addprefix uninstall-,$(modules)) cleanup-modules=$(addprefix cleanup-,$(modules))
.PHONY: all install uninstall check uninstall $(modules) \ .PHONY: all install cleanup check cleanup $(modules) \
$(install-objects) $(uninstall-objects) $(check-objects) \ $(install-objects) $(cleanup-objects) $(check-objects) \
$(install-modules) $(uninstall-modules) $(check-modules) \ $(install-modules) $(cleanup-modules) $(check-modules) \
$(reverse) $(reverse-objects) $(reverse-modules) $(reverse) $(reverse-objects) $(reverse-modules)
all: $(modules) $(objects) all: $(modules) $(objects)
ifeq ($(MAKEROOT),y) ifeq ($(MAKEROOT),y)
check: $(check-modules) $(check-objects) 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) reverse: $(reverse-modules) $(reverse-objects)
ifeq ($(firstword $(MAKEFILE_LIST)),Makefile.old) 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 @rmdir --ignore-fail-on-non-empty $(DESTDIR) 2> /dev/null || true
else else
uninstall: export NEWLIST = $(objects) cleanup: export NEWLIST = $(objects)
uninstall: cleanup:
@$(MAKE) -s -f Makefile.old uninstall @$(MAKE) -s -f Makefile.old cleanup
Makefile.old: $(firstword $(MAKEFILE_LIST)) Makefile.old: $(firstword $(MAKEFILE_LIST))
@cp "$^" "$@" @cp "$^" "$@"
@ -58,8 +58,8 @@ install:
@$(MAKE) -s -C ../ install @$(MAKE) -s -C ../ install
reverse: reverse:
@$(MAKE) -s -C ../ reverse @$(MAKE) -s -C ../ reverse
uninstall: cleanup:
@$(MAKE) -s -C ../ uninstall @$(MAKE) -s -C ../ cleanup
endif endif
$(modules): %: $(modules): %:
@ -84,15 +84,15 @@ $(reverse-objects): reverse-%:
$(reverse-modules): reverse-%: $(reverse-modules): reverse-%:
@$(MAKE) -s -C $* reverse MKDPREFIX=$(MKDPREFIX)$*/ @$(MAKE) -s -C $* reverse MKDPREFIX=$(MKDPREFIX)$*/
$(uninstall-objects): uninstall-%: $(cleanup-objects): cleanup-%:
@$(if $(findstring $*,$(NEWLIST)),, \ @$(if $(findstring $*,$(NEWLIST)),, \
@$(if $(call older,$*), \ @$(if $(call older,$*), \
echo -e "$(FG_RED)+ $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)", \ echo -e "$(FG_RED)+ $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)", \
echo -e "$(FG_GRE)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)"; \ echo -e "$(FG_GRE)- $(FG_YEL)$(MKDPREFIX)$*$(CLR_RE)"; \
unlink "$(DESTDIR)/$*" || true)) unlink "$(DESTDIR)/$*" || true))
$(uninstall-modules): uninstall-%: $(cleanup-modules): cleanup-%:
@$(MAKE) -C $* uninstall MKDPREFIX=$(MKDPREFIX)$*/ @$(MAKE) -C $* cleanup MKDPREFIX=$(MKDPREFIX)$*/
$(check-objects): check-%: $(check-objects): check-%:
@$(if $(call newer,$*), \ @$(if $(call newer,$*), \