diff options
| author | Aleksa Vučković <aleksav013@gmail.com> | 2022-05-24 02:27:37 +0200 |
|---|---|---|
| committer | Aleksa Vučković <aleksav013@gmail.com> | 2022-05-24 03:20:17 +0200 |
| commit | a5f5378f913d9bac3a5d686372cf1b8dda1cd835 (patch) | |
| tree | d790c7e4aea9087bd97f1935d6c76f96a425177e /include/00.build/Makefile | |
| parent | d4e20a9321b2ecdef110c60d267734203c7b5286 (diff) | |
lektorisanje
Diffstat (limited to 'include/00.build/Makefile')
| -rw-r--r-- | include/00.build/Makefile | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/00.build/Makefile b/include/00.build/Makefile index 03b5c11..d11d742 100644 --- a/include/00.build/Makefile +++ b/include/00.build/Makefile @@ -39,7 +39,7 @@ GCC_USR_DIR=$(shell $(CC) -print-file-name=) # TARGET -TARGET=myos +TARGET=aleksa_os BINARY=$(BUILD_DIR)/$(TARGET).bin ISO=$(TARGET).iso @@ -66,9 +66,12 @@ GRUB.CFG=$(SOURCE_DIR)/grub.cfg # RULES -.PHONY: all compile run run-iso clean install_headers +.PHONY: all clean compile install_headers iso run run-iso all: compile +clean: + $(RM) $(BUILD_DIR) $(ISO_DIR) $(ISO) + $(BINARY): $(OBJ) $(CC) -T $(LINKER) -o $(BINARY) $(CFLAGS) -nostdlib -lgcc $(OBJ) @@ -80,19 +83,22 @@ compile: @$(MAKE) --directory $(SOURCE_DIR) $(MAKE) $(BINARY) -$(ISO): $(BINARY) - grub-file --is-x86-multiboot $(BINARY) +$(ISO): $(OBJ) $(GRUB.CFG) +ifeq ($(shell ./scripts/is_multiboot.sh), 0) $(MKDIR) $(ISO_DIR)/boot/grub $(CP) $(BINARY) $(ISO_DIR)/boot/$(TARGET).bin $(CP) $(GRUB.CFG) $(ISO_DIR)/boot/grub/grub.cfg grub-mkrescue -o $(ISO) $(ISO_DIR) +else + @echo "$(BINARY) is not x86 multiboot compatible" + $(RM) $(BINARY) +endif + +iso: compile + $(MAKE) $(ISO) run: compile $(QEMU) -kernel $(BINARY) $(QEMU_DEBUG) -run-iso: compile - $(MAKE) $(ISO) +run-iso: iso $(QEMU) -cdrom $(ISO) - -clean: - $(RM) $(BUILD_DIR) $(ISO_DIR) $(ISO) |
