Skip to content

Commit 75f25a4

Browse files
committed
Show generated bootloader payload size in Makefile target
1 parent 1ce5865 commit 75f25a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ $(BUILD_DIR)/payload.bin: linker.ld $(PAYLOAD_FILES) $(ASSETS_HEADER) $(BUILD_DI
3737
-Os -ffreestanding -nostdlib -Wl,--build-id=none,--hash-style=sysv,--gc-sections,--print-map \
3838
-ffunction-sections -fdata-sections -Tlinker.ld -Wall -Wextra --param=min-pagesize=0 \
3939
-o '$@' $(PAYLOAD_CODE_FILES)
40+
@printf ' Payload size: %s bytes (%s)\n' \
41+
"$$(wc -c '$@' | cut -d' ' -f1)" \
42+
"$$(wc -c '$@' | cut -d' ' -f1 | numfmt --to=iec-i)"
4043

4144
$(BUILD_DIR)/disk.img: $(BUILD_DIR)/bootloader.bin $(BUILD_DIR)/payload.bin $(BUILD_DIR)
4245
@echo 'Generating 12 KiB (24 sectors) disk image: $@'

0 commit comments

Comments
 (0)