aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile30
-rw-r--r--README.md2
-rw-r--r--out/isodir/boot/grub/grub.cfg2
3 files changed, 23 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index c6e14b0..8453c31 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ TESTS = tests
TEST = $(TESTS)/debug.rc
TARGET = i686-elf
-ISO = myos
+ISO = gftos
ASM := $(sort $(shell find $(SRC) -name '*.s'))
C := $(sort $(shell find $(SRC) -name '*.c'))
@@ -41,15 +41,35 @@ INTERNAL_OBJS = $(CRTI_OBJ) $(ASM_OBJS) $(C_OBJS) $(CRTN_OBJ)
DEPS := $(OBJS:.o=.d)
.PHONY: all
+# Build gftos
all: $(OUT_DIR)/$(ISO).iso
+.PHONY: run
+# Run gftos in qemu
run: all
qemu-system-i386 -cdrom $(OUT_DIR)/$(ISO).iso
+.PHONY: test
+# Generate logfiles using bochs
test: all
mkdir -p $(BOCHS)
bochs -q -rc $(TEST)
+.PHONY: clean
+# Clean the build environment
+clean:
+ rm -rf $(BOCHS)
+ rm -rf $(INTERNAL_OBJS)
+ rm -rf $(OUT_DIR)/$(ISO).iso
+ rm -rf $(OUT_DIR)/isodir/boot/$(ISO).bin
+ rm -rf $(BUILD)
+
+# https://stackoverflow.com/a/35730928
+.PHONY: help
+# Show this help.
+help:
+ @awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
+
$(OUT_DIR)/$(ISO).iso : $(OUT_DIR)/isodir/boot/$(ISO).bin
grub-mkrescue -o $@ $(OUT_DIR)/isodir
@@ -65,11 +85,3 @@ $(BUILD)/%.o: $(SRC)/%.c
mkdir -p $(BUILD)
mkdir -p $(@D)
$(CC) $(CFLAGS) -c $^ -o $@
-
-
-clean:
- rm -rf $(BOCHS)
- rm -rf $(INTERNAL_OBJS)
- rm -rf $(OUT_DIR)/$(ISO).iso
- rm -rf $(OUT_DIR)/isodir/boot/$(ISO).bin
- rm -rf $(BUILD)
diff --git a/README.md b/README.md
index f3d7d49..ddfbc57 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ make
make install
cd $HOME/.local/src
-which -- $TARGET-as || echo $TARGET-as is not in the PATH
+command -v -- $TARGET-as || echo $TARGET-as is not in the PATH
curl https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz | tar -xJ
mkdir build-gcc
cd build-gcc
diff --git a/out/isodir/boot/grub/grub.cfg b/out/isodir/boot/grub/grub.cfg
index a4c18a7..ad2ba5e 100644
--- a/out/isodir/boot/grub/grub.cfg
+++ b/out/isodir/boot/grub/grub.cfg
@@ -1,7 +1,7 @@
set timeout=0
set default=0 # Set the default menu entry
-menuentry "myos" {
+menuentry "gftos" {
multiboot /boot/myos.bin
boot
}