diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-21 02:32:20 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-21 02:32:20 +0100 |
commit | 80513bc18ca32f5cc6a5b72e3ad812de3db9a6da (patch) | |
tree | 46814fe091491a106a2b460af21b088865a22f29 /Makefile | |
parent | 1d56c2712bde8ca43a0ea8e400c193dc3d0ce9e5 (diff) | |
download | cuddles-80513bc18ca32f5cc6a5b72e3ad812de3db9a6da.tar.xz |
make: track #include dependencies
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -9,20 +9,18 @@ override CFLAGS += \ -fno-stack-protector \ -nostartfiles \ -nodefaultlibs \ - -mgeneral-regs-only \ -Wall \ - -Wextra + -Wextra \ + -MMD -STAGE3 = \ +STAGE3_C = \ stage3/init.o \ stage3/main.o \ stage3/gfx.o \ stage3/halt.o \ stage3/interrupts.o \ - stage3/isr.o \ stage3/pic.o \ stage3/memory.o \ - stage3/paging.o \ stage3/heap.o \ stage3/font.o \ stage3/font_classic.o \ @@ -30,12 +28,16 @@ STAGE3 = \ stage3/string.o \ stage3/pci.o \ stage3/fs.o \ - stage3/yield.o \ stage3/ps2.o \ stage3/thread.o \ stage3/shell.o \ stage3/version.o +STAGE3 = $(STAGE3_C) \ + stage3/isr.o \ + stage3/yield.o \ + stage3/paging.o + PAD_BOUNDARY = pad() { truncate -s $$(echo "($$(du -b $$1 | cut -f1)+$$2-1)/$$2*$$2" | bc) $$1; }; pad DISAS = objdump -b binary -D -M intel -m i386:x86-64 stage3.bin --adjust-vma 0x9000 @@ -51,7 +53,7 @@ stage2.bin: stage2/main.asm stage2/mmap.asm stage2/paging.asm stage2/vesa.asm st nasm -f bin stage2/main.asm -o stage2.bin truncate -s 4608 stage2.bin -stage3.bin fs/dbg/kernel.map: $(STAGE3) stage3.ld +stage3.bin fs/dbg/kernel.map &: $(STAGE3) stage3.ld mkdir -p fs/dbg/ ld $(STAGE3) -T stage3.ld -Map=fs/dbg/kernel.map $(PAD_BOUNDARY) stage3.bin 512 @@ -66,6 +68,8 @@ stage3/%.o: stage3/%.asm stage3/%.o: stage3/%.c gcc $(CFLAGS) -c $< -o $@ +-include $(STAGE3_C:%.o=%.d) + GIT_VERSION := $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD) .version-$(GIT_VERSION): @@ -96,7 +100,7 @@ qemu_slow: cuddles.img run: qemu clean: - rm -rf .version-* stage3/*.o *.bin *.img stage3/{isr.asm,version.c} fs.tar fs/dbg + rm -rf .version-* stage3/*.{o,d} *.bin *.img stage3/{isr.asm,version.c} fs.tar fs/dbg flash: cuddles.img dd if=cuddles.img of=$(DEV) |