OSDN Git Service

buildsys: simplify include_clean greatly
authorMike Frysinger <vapier@gentoo.org>
Sun, 15 Jan 2012 18:33:11 +0000 (13:33 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 15 Jan 2012 18:35:33 +0000 (13:35 -0500)
Since we want to clean out all the headers we symlinked into include/,
just use `find` to locate all the symlinks for us.  This simplifies it
greatly, and actually fixes bugs where we build for one arch, switch
to another, and then do a clean but the previous arch headers are left
behind.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Makefile.in

index b7b4917..d0ac6c0 100644 (file)
@@ -466,23 +466,18 @@ defconfig: $(conf)
 menuconfig-clean-y:
        $(Q)$(MAKE) -C extra/config CLEAN_extra/config
 
+# The find here should continue to work as long as we are only symlinking
+# headers in to include/.  I don't see this changing to anything else, so
+# it should be fine.
 include_clean:
-       $(Q)$(RM) $(top_builddir)include/fpu_control.h $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h
-       @set -e; \
-       for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
-               $(RM) $(top_builddir)include/sys/$$i; \
-       done; \
-       if [ -d libc/sysdeps/linux/$(TARGET_ARCH)/sys ] ; then \
-               for i in `(cd libc/sysdeps/linux/$(TARGET_ARCH)/sys; ls *.h)` ; do \
-                       $(RM) $(top_builddir)include/sys/$$i; \
-               done; \
-       fi
+       $(SECHO) "  CLEAN include"
+       $(Q)$(RM) -r $(top_builddir)include/bits
+       $(Q)find $(top_builddir)include/ -type l -exec rm -f {} +
 
 clean: include_clean
-       $(Q)$(RM) -r $(top_builddir)lib $(top_builddir)include/bits
+       $(Q)$(RM) -r $(top_builddir)lib
        @$(MAKE) -C utils CLEAN_utils
        +$(MAKE) -s -C test clean
-       @$(RM) $(top_builddir)include/linux $(top_builddir)include/asm*
        $(Q)$(RM) $(top_builddir)extra/scripts/unifdef
        $(Q)$(RM) -r $(LOCAL_INSTALL_PATH)