Initial work on using make

This commit is contained in:
Ry 2022-11-01 15:59:06 -07:00
parent 5c04b293e1
commit ecdb2f1280
2 changed files with 25 additions and 11 deletions

25
Makefile Normal file
View File

@ -0,0 +1,25 @@
TARGET = foxdos
FILES = src/int21.s \
src/kernel.s
.PHONY: all qemu clean
all: prepare boot kernel img
qemu: all
qemu-system-i386 -fda $(TARGET)
prepare:
mkdir -p obj
boot: src/boot.s
nasm -I. -Isrc src/boot.s -o obj/boot.o
kernel: $(FILES)
nasm -I. -Isrc src/kernel.s -o obj/kernel.o
img:
cat obj/boot.o obj/kernel.o > $(TARGET)
clean:
rm -rf obj/ $(TARGET)

11
b
View File

@ -1,11 +0,0 @@
NAME=foxdos
rm $NAME
mkdir -p obj
# TODO this only works in root directory. might be good to just use a proper build system
nasm -I. -Isrc src/boot.s -o obj/boot
nasm -I. -Isrc src/kernel.s -o obj/kernel
cat obj/boot obj/kernel > $NAME