EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Base 3.14.12.5 make uninstall not removing bin or lib
From: "Johnson, Andrew N. via Core-talk" <[email protected]>
To: "Baker, Keith (DLSLtd,RAL,LSCI)" <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 12 Nov 2019 21:52:57 +0000
Hi Keith,

On 11/7/19 4:01 AM, Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk wrote:

After updating from R3.14.12.3 or R3.14.12.7 I now find that a “make uninstall” does not remove INSTALL_LOCATION_BIN or INSTALL_LOCATION_LIB.

 

In RULES_TOP the cleandirs: target checks if those directories are empty and if so removes them, but the check seems to fail even though the directories should have just been emptied by the uninstall: target.

 

This used to work until this change was introduced in R3.14.12.5,

 

-archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))

-              @$(MAKE) -f Makefile cleandirs

+archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) | cleandirs

Yeah, that's a bug that I introduced, sorry! I normally use 'make distclean' which removes all the O.<arch> directories and everything under the bin and lib directories unconditionally. 'make clean uninstall' only removes files for the target architectures that this host-arch is configured to build, and is more to type anyway.

For future releases I'm probably going to remove the cleandirs target and do something like this diff against the 3.15 tree (3.14 is no longer supported):

diff --git a/configure/RULES_TOP b/configure/RULES_TOP
--- a/configure/RULES_TOP
+++ b/configure/RULES_TOP
@@ -24,25 +24,19 @@ UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC) \
 uninstallDirs:
        $(RMDIR) $(UNINSTALL_DIRS)
 
+EMPTY_INSTALL_DIRS = \
+    $(if $(wildcard $(INSTALL_LOCATION_BIN)/*),,$(INSTALL_LOCATION_BIN)) \
+    $(if $(wildcard $(INSTALL_LOCATION_LIB)/*),,$(INSTALL_LOCATION_LIB))
 uninstall: archuninstall uninstallDirs
+       $(RMDIR) $(EMPTY_INSTALL_DIRS)

 
-archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) | cleandirs
+archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
 
 archPart = $(word 2, $(subst $(DIVIDER), ,$@))
 uninstall$(DIVIDER)%:
        $(RMDIR) $(INSTALL_LOCATION_BIN)/$(archPart)
        $(RMDIR) $(INSTALL_LOCATION_LIB)/$(archPart)
 
-cleandirs:
-       @$(NOP)
-ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),)
-       $(RMDIR) $(INSTALL_LOCATION_BIN)
-endif
-ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),)
-       $(RMDIR) $(INSTALL_LOCATION_LIB)
-endif
-
 

 help:
        @echo "Usage: gnumake [options] [target] ..."

This does the directory-is-empty tests after their contents have been removed but without having to use a recursive make call, which is what I was originally trying to clean up. A 'make archuninstall' will no longer remove the empty top-level bin and lib directories when deleting the last remaining architecture, but 'make uninstall' is less typing and should be close enough anyway.

Thanks for the bug report,

- Andrew
-- 
Complexity comes for free, Simplicity you have to work for.

Replies:
RE: Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk
References:
Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk

Navigate by Date:
Prev: [Merge] ~info-martin-konrad/epics-base:simplify-compiler-specific-macros into epics-base:3.15 Martin Konrad via Core-talk
Next: Build failed: epics-base base-integration-350 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk
Next: RE: Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 14 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·