projects
/
eightysix
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reorg done
[eightysix]
/
kern
/
Makefile
diff --git
a/kern/Makefile
b/kern/Makefile
index
44d9d66
..
70e479b
100644
(file)
--- 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
disk_numsec = 720
#disk_numsec = 2880
-bin = bootldr
-img = bootldr.img
+bin = 86kern
+img = 86kern.img
CC = ia16-elf-gcc
LD = ia16-elf-ld
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
$(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:
%.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
.PHONY: run
@@
-35,4
+46,4
@@
debug: $(img)
.PHONY: disasm
disasm: $(bin)
ndisasm -o 0x7c00 $< >dis1
.PHONY: disasm
disasm: $(bin)
ndisasm -o 0x7c00 $< >dis1
- ndisasm -o 0x80000 -e 512 $< >dis2
+ ndisasm -o 0x98000 -e 512 $< >dis2