[Buildroot] [PATCH] Avoid make distclean to remove packages fromrootfs

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Mon Oct 27 21:28:04 UTC 2008


On Mon, Oct 27, 2008 at 10:11:12PM +0100, Roberto A. Foglietta wrote:
>2008/10/27 Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>:
>> On Mon, Oct 27, 2008 at 09:42:42PM +0100, Roberto A. Foglietta wrote:
>
>[...]
>
>>
>>>--- Makefile   (revision 23784)
>>>+++ Makefile   (working copy)
>>>@@ -324,7 +324,7 @@
>>>               touch $(STAGING_DIR)/.fakeroot.00000; \
>>>       fi
>>>       -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
>>>-      -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf
>>>+      -find $(TARGET_DIR) -type f -name .empty -delete
>>>       touch $@
>>>
>>> $(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root
>>>@@ -341,6 +341,7 @@
>>>       find $(TARGET_DIR)/lib -name '*.a' -delete
>>>       find $(TARGET_DIR)/usr/lib -name '*.la' -delete
>>>       find $(TARGET_DIR)/lib -name '*.la' -delete
>>>+      find $(TARGET_DIR) -type f -name '*~' -delete
>>
>> No. Use xargs instead.
>
> Why?

config FEATURE_FIND_DELETE
        bool "Enable -delete option allowing to delete files"
        default n

>>> source: $(TARGETS_SOURCE) $(HOST_SOURCE)
>>>@@ -357,6 +358,19 @@
>>> # Cleanup and misc junk
>>> #
>>> #############################################################
>>>+
>>>+install: softclean all
>>>+      # TODO: to fix this bug in the proper way
>>>+      name=$$(find $(STAGING_DIR) -name 'libfreetype.so'); \
>>>+      dest=$$(dirname $$name | sed -e "s,$(STAGING_DIR),$(TARGET_DIR),"); \
>>>+      cp -af $$name* $$dest; $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $$dest/libfreetype.so
>>>+
>>>+rootclean:
>>>+      rm -rf $(TARGET_DIR) $(PROJECT_BUILD_DIR)/.root
>>>+
>>>+softclean:
>>>+      rm -rf $(IMAGE) $(PROJECT_BUILD_DIR)/autotools-stamps
>>>+
>>
>> No. Adding yet more targets makes absolutely no sense at all.
>> Just make 'make clean' wipe the stamps and let 'make realclean' wipe the
>> built stuff.
>
>clean remove a lot of things not only the stamps
>
>clean: $(TARGETS_CLEAN)
>	rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
>$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps
>
>a) you want reinstall things in root because they have been corrupted
>without loosing your customization on scripts/configurations:
>
>make install (which for work correctly need to do: softclean all, this
>is the reason because softclean exist)
>
>b) you want remove root and remade it from scratch
>
>make rootclean install
>
>in both a) and b) cases you want do these things in the fastest way.

Work out a setup which deals fine via
- clean
- realclean
- distclean

Everything else is too finegrained and doesn't help since it's not
intuitive.

>> And DOCUMENT that stuff in 'make help'!

> I will made some tests in order to show you how much time people can
>save in using some targets appropriately. Then if you will agree with
>me that those targets are really useful I will document them. Testing
>extensively the buildroot in many configuration implies to move AS
>FAST AS POSSIBLE from one build to another one without recompiling the
>WORLD.

I don't care about that, personally.
My tree is at least 50% faster when configuring stuff
(AUTO_CONFIGURE_TARGET) and furthermore compiles packages correctly, as
opposed to the thing you're using.



More information about the buildroot mailing list