Skip to content
Snippets Groups Projects
Commit 9c10b784 authored by Avi Kivity's avatar Avi Kivity
Browse files

build: fix sizing the image during a clean build

The shell call to stat(1) is evaluted when the rule to build the image is
triggered, at which point loader-stripped.elf does not exist yet.  This
causes stat to fail and the build to break.

Fix by moving the creation of loader-stripped.elf to its own target, so
that by the time the recipe is evaluated, the file is known to exist.
parent 484dee50
No related branches found
No related tags found
No related merge requests found
...@@ -160,10 +160,12 @@ boot.bin: arch/x64/boot16.ld arch/x64/boot16.o ...@@ -160,10 +160,12 @@ boot.bin: arch/x64/boot16.ld arch/x64/boot16.o
image-size = $(shell stat --printf %s loader-stripped.elf) image-size = $(shell stat --printf %s loader-stripped.elf)
loader.img: boot.bin loader.elf loader-stripped.elf: loader.elf
$(call quiet, dd if=boot.bin of=$@ > /dev/null 2>&1, DD $@ boot.bin)
$(call very-quiet, cp loader.elf loader-stripped.elf) $(call very-quiet, cp loader.elf loader-stripped.elf)
$(call very-quiet, strip loader-stripped.elf) $(call quiet, strip loader-stripped.elf, STRIP loader.elf)
loader.img: boot.bin loader-stripped.elf
$(call quiet, dd if=boot.bin of=$@ > /dev/null 2>&1, DD $@ boot.bin)
$(call quiet, dd if=loader-stripped.elf of=$@ conv=notrunc seek=128 > /dev/null 2>&1, \ $(call quiet, dd if=loader-stripped.elf of=$@ conv=notrunc seek=128 > /dev/null 2>&1, \
DD $@ loader.elf) DD $@ loader.elf)
$(call quiet, $(src)/scripts/imgedit.py setsize $@ $(image-size), IMGEDIT $@) $(call quiet, $(src)/scripts/imgedit.py setsize $@ $(image-size), IMGEDIT $@)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment