Improved uninstallation - more accurate attempts to remove all directories that were created when installing. Moved creation of ADDITIONAL_INSTALL_DIRS in Master invocation so they can also be removed accurately. Added .NOTPARALLEL as a safety measure

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@27716 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2009-01-29 00:21:36 +00:00
parent 5d1905c5f3
commit 67c70b37e0
6 changed files with 98 additions and 15 deletions

View file

@ -1,3 +1,32 @@
2009-01-28 Nicola Pero <nicola.pero@meta-innovation.com>
* rules.make (.NOTPARALLEL): Added target. It should turn off
parallel building - which does not work with gnustep-make - even
when specified on the command-line as 'make -j'.
2009-01-28 Nicola Pero <nicola.pero@meta-innovation.com>
* Instance/resource-set.make (internal-resource_set-uninstall_):
Rewritten to be much more accurate. In particular it now removes
LOCALIZED_RESOURCE_DIRS and RESOURCE_DIRS.
* Instance/Shared/headers.make
(shared-instance-headers-uninstall): Remove
GNUSTEP_HEADERS/HEADER_FILES_INSTALL_DIR if it is empty.
* Instance/rules.make (internal-$(GNUSTEP_TYPE)-uninstall): Remove
the $(GNUSTEP_INSTANCE)_INSTALL_DIRS if empty.
($(GNUSTEP_INSTANCE)_INSTALL_DIRS): New rule replacing the one for
ADDITIONAL_INSTALL_DIRS, moved into the Master invocation.
Do not add $(GNUSTEP_INSTANCE)_INSTALL_DIRS to
ADDITIONAL_INSTALL_DIRS.
* Master/rules.make (uninstall): Depend on
internal-after-uninstall.
(internal-after-uninstall): New rule to remove
ADDITIONAL_INSTALL_DIRS if empty.
($(ADDITIONAL_INSTALL_DIRS)): New rule.
(internal-before-install): New rule. Depend on
ADDITIONAL_INSTALL_DIRS.
(install): Depend on internal-before-install.
2009-01-28 Nicola Pero <nicola.pero@meta-innovation.com>
* rules.make: Replaced ${OEXT} with the equivalent syntax $(OEXT)

View file

@ -116,6 +116,8 @@ $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR)/% : $(HEADER_FILES_DIR)/%
endif
# Note that we create this directory, if not there yet. In the same
# way, upon uninstall, we delete the directory if it is empty.
$(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR):
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
@ -126,8 +128,6 @@ shared-instance-headers-uninstall:
rm -rf $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR)/$$file ; \
fi; \
done$(END_ECHO)
# TODO - during uninstall, it would be pretty to remove
# $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR) if it's empty.
-$(ECHO_NOTHING)rmdir $(GNUSTEP_HEADERS)/$(HEADER_FILES_INSTALL_DIR)$(END_ECHO)
endif # HEADER_FILES = ''

View file

@ -240,13 +240,28 @@ endif # LOCALIZED_RESOURCE_FILES
endif
# Here we try to remove the directories that we created on install.
# We use a plain rmdir to remove them; if you're manually installing
# any files in them (eg, in an 'after-install' custom rule), you need
# to make sure you remove them (in an 'before-uninstall' custom rule)
internal-resource_set-uninstall_:
ifneq ($(LOCALIZED_RESOURCE_FILES),)
-$(ECHO_NOTHING)for language in $(LANGUAGES); do \
$(ECHO_NOTHING)for language in $(LANGUAGES); do \
for file in $(LOCALIZED_RESOURCE_FILES); do \
rm -rf $(RESOURCE_FILES_INSTALL_DIR)/$$language.lproj/$$file;\
done; \
done$(END_ECHO)
endif
ifneq ($(LOCALIZED_RESOURCE_DIRS),)
-$(ECHO_NOTHING)for language in $(LANGUAGES); do \
for dir in $(LOCALIZED_RESOURCE_DIRS); do \
rmdir $(RESOURCE_FILES_INSTALL_DIR)/$$language.lproj/$$dir;\
done; \
done$(END_ECHO)
endif
ifneq ($(LOCALIZED_RESOURCE_FILES)$(LOCALIZED_RESOURCE_DIRS),)
-$(ECHO_NOTHING)for language in $(LANGUAGES); do \
rmdir $(RESOURCE_FILES_INSTALL_DIR)/$$language.lproj; \
done$(END_ECHO)
endif
@ -254,5 +269,12 @@ ifneq ($(RESOURCE_FILES),)
$(ECHO_NOTHING)for file in $(RESOURCE_FILES); do \
rm -rf $(RESOURCE_FILES_INSTALL_DIR)/$$file ; \
done$(END_ECHO)
-rmdir $(RESOURCE_FILES_INSTALL_DIR)
endif
ifneq ($(RESOURCE_DIRS),)
-$(ECHO_NOTHING)for dir in $(RESOURCE_DIRS); do \
rmdir $(RESOURCE_FILES_INSTALL_DIR)/$$dir ; \
done$(END_ECHO)
endif
ifneq ($(RESOURCE_FILES)$(RESOURCE_DIRS),)
-$(ECHO_NOTHING)rmdir $(RESOURCE_FILES_INSTALL_DIR)$(END_ECHO)
endif

View file

@ -126,23 +126,32 @@ internal-$(GNUSTEP_TYPE)-uninstall:: before-$(GNUSTEP_INSTANCE)-uninstall \
else
# By adding an ADDITIONAL_INSTALL_DIRS variable (or xxx_INSTALL_DIRS)
# you can request additional installation directories to be created
# before the first installation target is executed.
ADDITIONAL_INSTALL_DIRS += $($(GNUSTEP_INSTANCE)_INSTALL_DIRS)
$(ADDITIONAL_INSTALL_DIRS):
# By adding an xxx_INSTALL_DIRS variable you can request additional
# installation directories to be created before the first installation
# target is executed. You can also have general
# ADDITIONAL_INSTALL_DIRS directories that are always created before
# install is executed; this is done top-level in the Master
# invocation.
$($(GNUSTEP_INSTANCE)_INSTALL_DIRS):
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
internal-$(GNUSTEP_TYPE)-install:: $(ADDITIONAL_INSTALL_DIRS) \
internal-$(GNUSTEP_TYPE)-install:: $($(GNUSTEP_INSTANCE)_INSTALL_DIRS) \
before-$(GNUSTEP_INSTANCE)-install \
internal-$(GNUSTEP_TYPE)-install_ \
after-$(GNUSTEP_INSTANCE)-install
# It would be nice to remove ADDITIONAL_INSTALL_DIRS here, if empty.
# Here we remove the xxx_INSTALL_DIRS of this specific instance. The
# global ADDITIONAL_INSTALL_DIRS are removed in the top-level Master
# invocation. If we were to remove all of ADDITIONAL_INSTALL_DIRS
# here, we'd be doing that at every single uninstall target.
internal-$(GNUSTEP_TYPE)-uninstall:: before-$(GNUSTEP_INSTANCE)-uninstall \
internal-$(GNUSTEP_TYPE)-uninstall_ \
after-$(GNUSTEP_INSTANCE)-uninstall
ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIRS),)
-$(ECHO_NOTHING)for dir in $($(GNUSTEP_INSTANCE)_INSTALL_DIRS); do \
rmdir $$dir ; \
done$(END_ECHO)
endif
endif

View file

@ -81,13 +81,13 @@ distclean:: clean before-distclean internal-distclean after-distclean
export _GNUSTEP_TOP_INVOCATION_DONE = 1
else
# Sub-invocation of make
install:: before-install internal-install after-install internal-after-install
install:: internal-before-install before-install internal-install after-install internal-after-install
distclean:: before-distclean internal-distclean after-distclean
endif
uninstall:: before-uninstall internal-uninstall after-uninstall
uninstall:: before-uninstall internal-uninstall after-uninstall internal-after-uninstall
clean:: before-clean internal-clean after-clean
@ -119,6 +119,16 @@ else
internal-check-install-permissions:
endif
# By adding an ADDITIONAL_INSTALL_DIRS variable you can request
# additional installation directories to be created before the first
# installation target is executed. You can also have xxx_INSTALL_DIRS
# for specific instances, which are processed in the Instance
# invocation.
$(ADDITIONAL_INSTALL_DIRS):
$(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
internal-before-install:: $(ADDITIONAL_INSTALL_DIRS)
before-install::
internal-install::
@ -134,6 +144,13 @@ internal-uninstall::
after-uninstall::
internal-after-uninstall::
ifneq ($(ADDITIONAL_INSTALL_DIRS),)
-$(ECHO_NOTHING)for dir in $(ADDITIONAL_INSTALL_DIRS); do \
rmdir $$dir ; \
done$(END_ECHO)
endif
before-clean::
internal-clean::

View file

@ -360,6 +360,12 @@ VPATH = .
# error occurs.
.DELETE_ON_ERROR:
# gnustep-make supports inherently sequential targets such as
# 'before-install' and 'after-install' which make it really difficult
# to support parallel building. At the moment, parallel building is
# not supported, so make sure to disable it.
.NOTPARALLEL:
# Disable all built-in suffixes for performance.
.SUFFIXES: