X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=kern%2FMakefile;fp=kern%2FMakefile;h=70e479b0f91a658394716e481a47e63b39c30d64;hb=5145ed1e2adefc9c66e20681532a3a7cd6c2de01;hp=44d9d66a40251c33dce5d47965a24c22a4f37c75;hpb=426ed1c5006c82261fee2eea3feafe3282b2b862;p=eightysix diff --git a/kern/Makefile b/kern/Makefile index 44d9d66..70e479b 100644 --- a/kern/Makefile +++ b/kern/Makefile @@ -1,27 +1,38 @@ +csrc = $(wildcard src/*.c) +ssrc = $(wildcard src/*.asm) +obj = $(csrc:.c=.o) $(ssrc:.asm=.o) +dep = $(csrc:.c=.d) + disk_numsec = 720 #disk_numsec = 2880 -bin = bootldr -img = bootldr.img +bin = 86kern +img = 86kern.img CC = ia16-elf-gcc LD = ia16-elf-ld -CFLAGS = -march=i8088 -mtune=i8088 +CFLAGS = -march=i8088 -mtune=i8088 -MMD $(img): $(bin) dd if=/dev/zero of=$@ bs=512 count=$(disk_numsec) dd if=$< of=$@ bs=512 conv=notrunc -$(bin): boot/boot.o boot/boot2.o boot/main.o - $(LD) -T boot.ld -Map boot.map -o $@ $^ +$(bin): $(obj) + $(LD) -T kern.ld -Map kern.map -o $@ $(obj) + +-include $(dep) %.o: %.asm nasm -o $@ -f elf $< .PHONY: clean clean: - rm -f boot/*.o $(bin) + rm -f $(obj) $(bin) + +.PHONY: cleandep +cleandep: + rm -f $(dep) .PHONY: run @@ -35,4 +46,4 @@ debug: $(img) .PHONY: disasm disasm: $(bin) ndisasm -o 0x7c00 $< >dis1 - ndisasm -o 0x80000 -e 512 $< >dis2 + ndisasm -o 0x98000 -e 512 $< >dis2