mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-25 19:40:35 -09:00
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>
(cherry picked from commit aa1e74745c)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
958c6986a3
commit
8c4fc019ee
16
Makefile
16
Makefile
@@ -728,6 +728,10 @@ $(TARGETS_ROOTFS): target-finalize
|
||||
# Avoid the rootfs name leaking down the dependency chain
|
||||
target-finalize: ROOTFS=
|
||||
|
||||
TARGET_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list.txt))
|
||||
HOST_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list-host.txt))
|
||||
STAGING_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list-staging.txt))
|
||||
|
||||
.PHONY: host-finalize
|
||||
host-finalize: $(PACKAGES) $(HOST_DIR) $(HOST_DIR_SYMLINK)
|
||||
@$(call MESSAGE,"Finalizing host directory")
|
||||
@@ -807,12 +811,12 @@ endif # merged /usr
|
||||
|
||||
touch $(TARGET_DIR)/usr
|
||||
|
||||
cat $(sort $(wildcard $(BUILD_DIR)/*/.files-list.txt)) > \
|
||||
$(BUILD_DIR)/packages-file-list.txt
|
||||
cat $(sort $(wildcard $(BUILD_DIR)/*/.files-list-host.txt)) > \
|
||||
$(BUILD_DIR)/packages-file-list-host.txt
|
||||
cat $(sort $(wildcard $(BUILD_DIR)/*/.files-list-staging.txt)) > \
|
||||
$(BUILD_DIR)/packages-file-list-staging.txt
|
||||
$(if $(TARGET_DIR_FILES_LISTS), \
|
||||
cat $(TARGET_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list.txt
|
||||
$(if $(HOST_DIR_FILES_LISTS), \
|
||||
cat $(HOST_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list-host.txt
|
||||
$(if $(STAGING_DIR_FILES_LISTS), \
|
||||
cat $(STAGING_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list-staging.txt
|
||||
|
||||
.PHONY: target-post-image
|
||||
target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
|
||||
|
||||
Reference in New Issue
Block a user