From 02a7627734dd789232438fa0cb682c9a6c1453b2 Mon Sep 17 00:00:00 2001 From: Nero <41307858+nero@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:44:39 +0000 Subject: [PATCH] makefile: Add size output for generated binaries --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5632308..96f75c8 100644 --- a/Makefile +++ b/Makefile @@ -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