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))
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,$*), \