diff options
author | Joursoir <chat@joursoir.net> | 2022-09-28 20:12:00 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2022-10-04 03:04:30 +0300 |
commit | f4deaf87d42fdfd696daa87c4bae7b2727dabbad (patch) | |
tree | dc6fca525bef1331fad2afa3dbf8b45f09a8c283 | |
parent | 36501d7d38ca32031c8401fed67c4cb684a9f495 (diff) | |
download | mfsos-f4deaf87d42fdfd696daa87c4bae7b2727dabbad.tar.gz mfsos-f4deaf87d42fdfd696daa87c4bae7b2727dabbad.tar.bz2 mfsos-f4deaf87d42fdfd696daa87c4bae7b2727dabbad.zip |
makefile: add a choice of booting mechanism
-rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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 |