Makefile: don't hang the build if there are no file lists
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 18 Mar 2020 15:58:11 +0000 (16:58 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Fri, 20 Mar 2020 21:13:51 +0000 (22:13 +0100)
commitaa1e74745c93534a14981616b92956e920a01dc5
tree5b3f62495ab10312ed0b1e19d4ef2a4860386810
parent6274868bd12d86a1e4d58f7a7a479ba76ff56532
Makefile: don't hang the build if there are no file lists

In very limited configurations, it is possible to have a case where no
.files-list-staging.txt files are created. In this case:

    cat $(sort $(wildcard $(BUILD_DIR)/*/.files-list-staging.txt)) > \
        $(BUILD_DIR)/packages-file-list-staging.txt

becomes:

    cat > \
        $(BUILD_DIR)/packages-file-list-staging.txt

which of course makes the build hang.. forever.

So we fix this by checking the list is not empty. To keep the code
readable, we introduce an intermediate variable to store the list of
these files.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
[yann.morin.1998@free.fr: always create the file, even if empty]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Makefile