aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 23 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e5cc6b6..e0dba8f 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ info:
@echo " LD ${LD} ${LDFLAGS}"
@${LD} --version | head -n1
-all: lib/libk.a ${ARCH}/arch.a devices/devs.a
+all: lib/libk.a ${ARCH}/arch.a devices/devs.a src/kernel.a
lib/libk.a:
${MAKE} ARCH=${ARCH} -C lib libk.a
@@ -21,9 +21,31 @@ i686/arch.a:
${MAKE} ARCH=${ARCH} -C i686 arch.a
devices/devs.a:
${MAKE} ARCH=${ARCH} -C devices devs.a
+src/kernel.a:
+ ${MAKE} ARCH=${ARCH} -C src kernel.a
+
+glitch.elf: ${ARCH}/arch.a devices/devs.a lib/libk.a src/kernel.a
+ ${LD} ${LDFLAGS} -T ${ARCH}/linker.ld -o $@\
+ $(wildcard i686/*.o) \
+ src/kernel.a \
+ -Llib -lk devices/devs.a
+
+glitch.iso: glitch.elf grub/grub.cfg
+ mkdir -p isodir/boot/grub
+ mkdir -p isodir/boot/glitch
+ cp grub/grub.cfg isodir/boot/grub/grub.cfg
+ cp glitch.elf isodir/boot/glitch/glitch.elf
+ grub-mkrescue -o glitch.iso isodir
+
+run: glitch.iso
+ qemu-system-i386 -cdrom glitch.iso -accel kvm
clean:
${MAKE} ARCH=${ARCH} -C lib clean
${MAKE} ARCH=${ARCH} -C ${ARCH} clean
${MAKE} ARCH=${ARCH} -C devices clean
+ ${MAKE} ARCH=${ARCH} -C src clean
+purge: clean
+ rm -f lib/libk.a ${ARCH}/arch.a devices/devs.a src/kernel.a
+ rm -rf isodir