all: fix wildcard to work with make-4.x default tip
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Wed Jun 25 23:33:01 2014 +0200 (2014-06-25)
changeset 3325069f43a215cc
parent 3324 1eea25c0bfe7
all: fix wildcard to work with make-4.x

In make-3.8x, the $(wildacrd) function would sort the entries,
while in make-4.x, it would just return the entries in any
unpredictable order [*]

Use the $(sort) function to get reproducible behaviour.

[*] Well, most probably the roder the entries appear when read
from readdir()

Reported-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
config/config.mk
kconfig/Makefile
samples/samples.mk
     1.1 --- a/config/config.mk	Mon May 26 23:25:17 2014 +0200
     1.2 +++ b/config/config.mk	Wed Jun 25 23:33:01 2014 +0200
     1.3 @@ -15,17 +15,17 @@
     1.4  $(STATIC_CONFIG_FILES): config
     1.5  
     1.6  # Build a list of per-component-type source config files
     1.7 -ARCH_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
     1.8 -ARCH_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
     1.9 -KERNEL_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
    1.10 -KERNEL_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
    1.11 -CC_CONFIG_FILES         = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
    1.12 -CC_CONFIG_FILES_2       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
    1.13 -BINUTILS_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in))
    1.14 -BINUTILS_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in.2))
    1.15 -LIBC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
    1.16 -LIBC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
    1.17 -DEBUG_CONFIG_FILES      = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
    1.18 +ARCH_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/arch/*.in)))
    1.19 +ARCH_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/arch/*.in.2)))
    1.20 +KERNEL_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/kernel/*.in)))
    1.21 +KERNEL_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2)))
    1.22 +CC_CONFIG_FILES         = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/cc/*.in)))
    1.23 +CC_CONFIG_FILES_2       = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/cc/*.in.2)))
    1.24 +BINUTILS_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/binutils/*.in)))
    1.25 +BINUTILS_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/binutils/*.in.2)))
    1.26 +LIBC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/libc/*.in)))
    1.27 +LIBC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/libc/*.in.2)))
    1.28 +DEBUG_CONFIG_FILES      = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/debug/*.in)))
    1.29  
    1.30  # Build the list of generated config files
    1.31  GEN_CONFIG_FILES = config.gen/arch.in     \
     2.1 --- a/kconfig/Makefile	Mon May 26 23:25:17 2014 +0200
     2.2 +++ b/kconfig/Makefile	Wed Jun 25 23:33:01 2014 +0200
     2.3 @@ -25,7 +25,7 @@
     2.4  $(COMMON_OBJ) $(COMMON_DEP): CFLAGS += $(INTL_CFLAGS) -I.
     2.5  
     2.6  # lxdialog source files
     2.7 -LX_SRC = $(wildcard lxdialog/*.c)
     2.8 +LX_SRC = $(sort $(wildcard lxdialog/*.c))
     2.9  LX_OBJ = $(patsubst %.c,%.o,$(LX_SRC))
    2.10  LX_DEP = $(patsubst %.o,%.dep,$(LX_OBJ))
    2.11  $(LX_OBJ) $(LX_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
     3.1 --- a/samples/samples.mk	Mon May 26 23:25:17 2014 +0200
     3.2 +++ b/samples/samples.mk	Wed Jun 25 23:33:01 2014 +0200
     3.3 @@ -2,8 +2,8 @@
     3.4  
     3.5  # ----------------------------------------------------------
     3.6  # Build the list of available samples
     3.7 -CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))
     3.8 -CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config)))
     3.9 +CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(sort $(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config)))
    3.10 +CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(sort $(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config))))
    3.11  CT_SAMPLES := $(shell echo $(sort $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES))  \
    3.12                        |$(sed) -r -e 's/ /\n/g;'                         \
    3.13                        |$(sed) -r -e 's/(.*),(.*)/\2,\1/;'               \