2011-01-17 22:58:31 +03:00
|
|
|
include Makefile.inc
|
|
|
|
|
|
|
|
DIRS = core
|
|
|
|
|
2011-01-29 23:52:44 +03:00
|
|
|
.PHONY: all clean install core run curses
|
2011-01-16 04:01:19 +03:00
|
|
|
|
|
|
|
all: kernel
|
|
|
|
|
|
|
|
install: kernel
|
2011-01-19 18:51:59 +03:00
|
|
|
cp bootdisk.src.img bootdisk.img
|
2011-01-16 04:01:19 +03:00
|
|
|
mount bootdisk.img /mnt -o loop
|
|
|
|
cp kernel /mnt/kernel
|
2011-01-22 10:22:46 +03:00
|
|
|
cp initrd /mnt/initrd
|
2011-01-16 04:01:19 +03:00
|
|
|
umount /mnt
|
2011-01-17 22:46:38 +03:00
|
|
|
cp kernel /boot/toaruos-kernel
|
2011-01-16 04:01:19 +03:00
|
|
|
|
2011-01-19 09:04:27 +03:00
|
|
|
run: bootdisk.img
|
|
|
|
qemu -fda bootdisk.img
|
|
|
|
|
2011-01-29 23:52:44 +03:00
|
|
|
curses: bootdisk.img
|
|
|
|
qemu -curses -fda bootdisk.img
|
|
|
|
|
2011-01-17 22:58:31 +03:00
|
|
|
kernel: start.o link.ld main.o core
|
2011-01-29 08:09:09 +03:00
|
|
|
${LD} -T link.ld -o kernel *.o core/*.o core/fs/*.o
|
2011-01-16 04:01:19 +03:00
|
|
|
|
|
|
|
%.o: %.c
|
2011-01-17 22:58:31 +03:00
|
|
|
${CC} ${CFLAGS} -I./include -c -o $@ $<
|
|
|
|
|
|
|
|
core:
|
|
|
|
cd core; ${MAKE} ${MFLAGS}
|
2011-01-16 04:01:19 +03:00
|
|
|
|
|
|
|
start.o: start.asm
|
|
|
|
nasm -f elf -o start.o start.asm
|
|
|
|
|
|
|
|
clean:
|
2011-01-17 22:58:31 +03:00
|
|
|
-rm -f *.o kernel
|
2011-01-19 22:54:01 +03:00
|
|
|
-rm -f bootdisk.img
|
2011-01-17 22:58:31 +03:00
|
|
|
-for d in ${DIRS}; do (cd $$d; ${MAKE} clean); done
|