Skip to contentSkip to conversation

infra: allow running 'make clean menuconfig ; make *-menuconfig'

PATCH New Samuel Martin 2 participants 2 messages May 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infra: allow running 'make clean menuconfig ; make *-menuconfig'

This patch adds host-ccache to the dependency list of any package if BR2_CCACHE is enable.

Fixes bug #5678

Also, drop some explicit redundant host-ccache dependencies that intend to fix this kind of issue.

Note that, only the uClibc dependency on host-ccache remains since uClibc does not use any of the Buildroot package infrastructure yet.

---
 package/crosstool-ng/crosstool-ng.mk |  2 +-
 package/pkg-generic.mk               | 12 ++++++++++++
 package/sstrip/sstrip.mk             |  5 -----
 3 files changed, 13 insertions(+), 6 deletions(-)
package/crosstool-ng/crosstool-ng.mk +1 -1
index b533396..0b96b50 100644
@@ -5,7 +5,7 @@ CROSSTOOL_NG_INSTALL_TARGET    = NO
 CROSSTOOL_NG_MAKE              = $(MAKE1)
 
 HOST_CROSSTOOL_NG_DEPENDENCIES = \
-	$(if $(BR2_CCACHE),host-ccache) host-gawk \
+	host-gawk \
 	host-automake host-gperf host-bison host-flex \
 	host-texinfo
 
package/pkg-generic.mk +12 -0
index 56fca6b..1c8d182 100644
@@ -306,6 +306,18 @@ $(2)_REDISTRIBUTE		?= YES
 
 $(2)_DEPENDENCIES ?= $(filter-out $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
 
+# Inconditionnaly add host-ccache dependency when BR2_CCACHE is enabled.
+# This allows to run the following without failing on test the compiler
+# because the ccache binary is not yet built:
+#
+# $ make clean menuconfig
+# $ make [linux|ctng|uclibc|barebox|busybox]-menuconfig
+ifeq ($(BR2_CCACHE),y)
+ifneq ($(1),host-ccache)
+$(2)_DEPENDENCIES += host-ccache
+endif
+endif
+
 $(2)_INSTALL_STAGING		?= NO
 $(2)_INSTALL_IMAGES		?= NO
 $(2)_INSTALL_TARGET		?= YES
package/sstrip/sstrip.mk +0 -5
index e078b2c..3c29c52 100644
@@ -8,11 +8,6 @@ SSTRIP_SITE = svn://dev.openwrt.org/openwrt/trunk/tools/sstrip
 SSTRIP_VERSION = 20154
 HOST_SSTRIP_BINARY = $(GNU_TARGET_NAME)-sstrip
 
-# This is a kludge to get host-ccache built before us or it fails
-ifeq ($(BR2_CCACHE),y)
-HOST_SSTRIP_DEPENDENCIES = host-ccache
-endif
-
 define SSTRIP_BUILD_CMDS
 	cd $(@D) ; \
 	$(TARGET_CC) $(TARGET_CFLAGS) -include endian.h -include byteswap.h \
Signature · 1 line
1.8.3
#1 lore raw

PATCH 1/1 infra: allow running 'make clean menuconfig ; make *-menuconfig'

Dear Samuel Martin,

package/pkg-generic.mk $(2)_REDISTRIBUTE ?= YES · line 319

Quoted 11 lines · Samuel Martin
package/pkg-generic.mk +11 -0
+# Inconditionnaly add host-ccache dependency when BR2_CCACHE is enabled.
+# This allows to run the following without failing on test the compiler
+# because the ccache binary is not yet built:
+#
+# $ make clean menuconfig
+# $ make [linux|ctng|uclibc|barebox|busybox]-menuconfig
+ifeq ($(BR2_CCACHE),y)
+ifneq ($(1),host-ccache)
+$(2)_DEPENDENCIES += host-ccache
+endif
+endif

I am not sure we want to make this specific to the ccache problem. The linux-menuconfig target also needs to depend on "dirs" so that the base directories need to be created.

Shouldn't we depend on something like $(BASE_TARGETS) instead, which will then contain "host-ccache dirs", and everything that's needed? Also, all packages depend on the toolchain (but beware, binutils is also a package, and is part of the toolchain).

So just like everything in the core infrastructure: I don't want a patch that just fixes the particular problem of this bug by adding more crap. I want something that clarifies the dependency of packages on "base" things, and makes it work properly.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com