Skip to content

Commit

Permalink
Makefile: fix dependencies
Browse files Browse the repository at this point in the history
All the run-style targets depend on a valid ISO file being created, so
let's make that explicit.

Signed-off-by: Bjoern Doebel <[email protected]>

fixup! Makefile: fix dependencies
  • Loading branch information
bjoernd authored and wipawel committed Aug 12, 2020
1 parent 902502a commit 50b809c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,28 @@ QEMU_PARAMS_DEBUG := -s &

ISO_FILE := boot.iso

.PHONY: iso
iso: all
$(ISO_FILE): all
@echo "GEN ISO" $(ISO_FILE)
@ $(GRUB_FILE) --is-x86-multiboot $(TARGET) || { echo "Multiboot not supported"; exit 1; }
@ cp $(TARGET) grub/boot/
@ $(GRUB_MKIMAGE) --format i386-pc-eltorito -p /boot/grub -o grub/boot.img $(GRUB_MODULES)
@ $(XORRISO) -as mkisofs -U -b boot.img -no-emul-boot -boot-load-size 4 -boot-info-table -o $(ISO_FILE) grub 2>> /dev/null

.PHONY: boot
boot: all
boot: $(ISO_FILE)
@echo "QEMU START"
@$(QEMU_BIN) -cdrom $(ISO_FILE) $(QEMU_PARAMS)

.PHONY: boot_debug
boot_debug: all iso
boot_debug: $(ISO_FILE)
$(QEMU_BIN) -cdrom $(ISO_FILE) $(QEMU_PARAMS) $(QEMU_PARAMS_DEBUG)

.PHONY: run
run: all
run: $(TARGET)
$(QEMU_BIN) -kernel $(TARGET) $(QEMU_PARAMS) $(QEMU_PARAMS_KERNEL)

.PHONY: debug
debug: all
debug: $(TARGET)
$(QEMU_BIN) -kernel $(TARGET) $(QEMU_PARAMS) $(QEMU_PARAMS_KERNEL) $(QEMU_PARAMS_DEBUG)

.PHONY: gdb
Expand Down

0 comments on commit 50b809c

Please sign in to comment.