PATCH: support make clean-target-libgcc

Ben Elliston bje@au1.ibm.com
Fri Nov 25 06:44:00 GMT 2005


This patch has been in my tree for a while, waiting for stage 1.  Its
purpose is to add support for `make clean-target-libgcc'.  It works
from either the top-level or the gcc directory of the build tree.
If/when libgcc lives in its own top-level directory, we can ensure
that this make target transparently continues to work.

Tested with a native build on i686-linux.  Okay for the trunk?

Ben

==> ChangeLog <==
2005-11-25  Ben Elliston  <bje@au.ibm.com>

        * Makefile.tpl (clean-target-libgcc): Invoke clean-target-libgcc
        from the gcc build directory.
        * Makefile.in: Regenerate.

==> gcc/ChangeLog <==
2005-11-25  Ben Elliston  <bje@au.ibm.com>

        * Makefile.in (clean-target): Depend on clean-target-libgcc.
        (clean-target-libgcc): Import rule from the top-level Makefile.in.

Index: Makefile.tpl
===================================================================
--- Makefile.tpl        (revision 107486)
+++ Makefile.tpl        (working copy)
@@ -842,11 +842,7 @@ realclean: maintainer-clean
 # Extra dependency for clean-target, owing to the mixed nature of gcc
 clean-target: clean-target-libgcc
 clean-target-libgcc:
-       test ! -d gcc/libgcc || \
-       (cd gcc/libgcc && find . -type d -print) | \
-       while read d; do rm -f gcc/$$d/libgcc.a || : ; done
-       -rm -rf gcc/libgcc
-       -rm -f gcc/stmp-dirs
+       (cd gcc && $(MAKE) $@)
 
 # Check target.
 
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in     (revision 107486)
+++ gcc/Makefile.in     (working copy)
@@ -3423,6 +3423,18 @@ fsf-funding.pod: funding.texi
        -$(TEXI2POD) $< > $@
 
 #

+# clean-target removes all files made by compilation.
+# This can be added to over time.
+
+clean-target: clean-target-libgcc
+
+clean-target-libgcc:
+       test ! -d libgcc || \
+       (cd libgcc && find . -type d -print) | \
+       while read d; do rm -f $$d/libgcc.a || : ; done
+       -rm -r libgcc
+       -rm stmp-dirs
+
 # Deletion of files made during compilation.
 # There are four levels of this:
 #   `mostlyclean', `clean', `distclean' and `maintainer-clean'.



More information about the Gcc-patches mailing list