Espresso 0.0.2a
This commit is contained in:
25
Makefile
25
Makefile
@ -4,15 +4,16 @@ ISO := boot/espresso.iso
|
||||
CC := i686-elf-gcc
|
||||
AS := i686-elf-as
|
||||
NASM := nasm
|
||||
QEMU_MKE_IMG := qemu-img create -f raw espresso.img 256M
|
||||
QEMU_MKE_IMG := qemu-img create -f raw espresso.img 64M
|
||||
MKFS_VFAT := sudo mkfs.vfat
|
||||
MKFS_FLAGS := -F 32 -S 512
|
||||
NASMFLAGS := -f elf32
|
||||
WNOFLAGS := -Wno-discarded-qualifiers
|
||||
CFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -msse4 $(WNOFLAGS)
|
||||
LDFLAGS := -T linker.ld -ffreestanding -O2 -nostdlib
|
||||
CFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -msse $(WNOFLAGS) -nostdlib -nostartfiles -include kincl.h
|
||||
LDFLAGS := -T linker.ld -ffreestanding -O2 -nostdlib -nostartfiles
|
||||
QEMUFLAGS := -boot d -cdrom $(ISO) -drive file=espresso.img,format=raw,if=ide,readonly=off,rerror=report,werror=report -cpu qemu32,sse4.1
|
||||
QEMUFLGS_EXT := -net none -netdev user,id=n0 -device rtl8139,netdev=n0 -vga std #-singlestep
|
||||
QEMUFLGS_EXT := -vga std -d int,cpu_reset -D qemu.log -no-reboot #-singlestep
|
||||
MOR_QEMUFLGS := -net none -netdev user,id=n0 -device rtl8139,netdev=n0 -serial file:serial.log
|
||||
SRC_DIRS := kernel drivers lib
|
||||
INCLUDE_DIRS := include
|
||||
ARCH_DIR := arch
|
||||
@ -46,6 +47,10 @@ buildc: all iso run clean
|
||||
# === Default target ===
|
||||
all: $(TARGET)
|
||||
|
||||
# === Debug build ===
|
||||
debug:
|
||||
$(MAKE) clean
|
||||
$(MAKE) CFLAGS="$(CFLAGS) -D_DEBUG" $(TARGET)
|
||||
|
||||
# === Linking ===
|
||||
$(TARGET): ./arch/x86/boot/boot.o $(filter-out boot.o, $(OBJ_LINK_LIST))
|
||||
@ -73,10 +78,11 @@ iso: $(TARGET)
|
||||
|
||||
# === Run in QEMU ===
|
||||
run: iso
|
||||
$(QEMU_MKE_IMG)
|
||||
echo "\n"
|
||||
$(MKFS_VFAT) $(MKFS_FLAGS) espresso.img
|
||||
qemu-system-i386 $(QEMUFLAGS) $(QEMUFLGS_EXT)
|
||||
@if [ ! -f espresso.img ]; then \
|
||||
$(QEMU_MKE_IMG); \
|
||||
fi
|
||||
@echo
|
||||
qemu-system-i386 $(QEMUFLAGS) $(QEMUFLGS_EXT) $(MOR_QEMUFLGS)
|
||||
|
||||
|
||||
# === Clean all build artifacts ===
|
||||
@ -85,5 +91,4 @@ clean:
|
||||
rm -rf $(ISO_DIR)
|
||||
rm -f espresso.img
|
||||
|
||||
.PHONY: all clean iso run
|
||||
|
||||
.PHONY: all clean iso run debug build buildc
|
||||
|
||||
Reference in New Issue
Block a user