summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index caf5939..570e4a8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,17 @@
OSNAME = mfsos
OSBIN = $(OSNAME).bin
KERNBIN = kernel.bin
+# Available options: `bootloader`, `multiboot`
+BOOT ?= bootloader
ARCH = x86
-ARCH_BOOT = arch/$(ARCH)/boot/bootloader
+ARCH_BOOT = arch/$(ARCH)/boot/$(BOOT)
+
BOOTBIN = $(ARCH_BOOT)/bootloader.bin
+OS_BINARIES = $(KERNBIN)
+ifeq ($(BOOT), bootloader)
+ OS_BINARIES := $(BOOTBIN) $(OS_BINARIES)
+endif
TARGET = i686-elf
TARGET_TOOLS = $(PWD)/tools/toolchain/bin/$(TARGET)-
@@ -26,7 +33,7 @@ export CC LD AS OBJDUMP
all: $(OSBIN)
-$(OSBIN): $(BOOTBIN) $(KERNBIN)
+$(OSBIN): $(OS_BINARIES)
cat $^ > $@
dd if=/dev/zero bs=512 count=128 >> $@ # 65536