ATT = $(SRC:.c=.att) EXE = $(basename $(SRC)) SRC = $(wildcard *.c) CFLAGS = -ffreestanding -g -nostdlib -m32 -Og -static -Tlinker.ld -Wall -Werror -Wl,-melf_i386 all: qemu | att att: $(ATT) clean: kill $(RM) $(ATT) $(EXE) core.* *~ exe: $(EXE) kill: -killall -q qemu-system-i386 || true qemu: $(EXE) qemu-system-i386 -drive file=$<,format=raw &> /dev/null & %.att: % objdump -b binary -m i8086 -D $< > $@ .PHONY: all att clean exe kill qemu