makefile: Add size output for generated binaries

This commit is contained in:
Nero 2021-12-14 17:44:39 +00:00
parent 95381ffdc3
commit 02a7627734

View File

@ -3,17 +3,18 @@ KERNEL = @rdos.com
DISTFILES = $(KERNEL) $(PROGRAMS)
ROMS =
QEMU = qemu-system-i386
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
VERSION = $(shell git log -1 --format=%cd --date=format:%Y%m%d)
PRODUCT = rdos
QEMU = qemu-system-i386
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
QEMU_ARGS += $(shell test -w /dev/kvm && echo --enable-kvm)
METRIC = stat -c '%8s %n'
NASM = nasm
NASM_ARGS = -s -Isrc --before "cpu 8086" -DPRODUCT=$(PRODUCT) -DVERSION=$(VERSION)
QEMU_ARGS += $(shell test -w /dev/kvm && echo --enable-kvm)
ifdef DEBUG
ROMS += dprintf.rom
NASM_ARGS += -l $(basename $@).lst -DDEBUG=1
@ -38,6 +39,7 @@ host/%.elf: host/%.c
# COM programs
%.com: src/%.asm src/*.inc
$(NASM) $(NASM_ARGS) -l $(@:.com=.lst) -o $@ $<
$(METRIC) $@
# Bootloaders, first sector on partition
%.bs: boot/%.asm