Espresso 0.0.2c
This commit is contained in:
24
Makefile
24
Makefile
@ -1,18 +1,19 @@
|
||||
# === Config ===
|
||||
TARGET := boot/espresso.elf
|
||||
ISO := boot/espresso.iso
|
||||
FAT16_DISK := espresso.img
|
||||
CC := i686-elf-gcc
|
||||
AS := i686-elf-as
|
||||
NASM := nasm
|
||||
QEMU_MKE_IMG := qemu-img create -f raw espresso.img 64M
|
||||
QEMU_MKE_IMG := qemu-img create -f raw $(FAT16_DISK) 64M
|
||||
MKFS_VFAT := sudo mkfs.vfat
|
||||
MKFS_FLAGS := -F 16 -S 512
|
||||
NASMFLAGS := -f elf32
|
||||
WNOFLAGS := -Wno-discarded-qualifiers
|
||||
CFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -msse $(WNOFLAGS) -nostdlib -nostartfiles -include 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 := -vga std -d int,cpu_reset -D qemu.log -no-reboot #-singlestep
|
||||
QEMUFLAGS := -no-shutdown -boot d -cdrom $(ISO) -drive file=$(FAT16_DISK),format=raw,if=ide,readonly=off,rerror=report,werror=report -cpu qemu32,sse4.1
|
||||
QEMUFLGS_EXT := -vga std -d int,cpu_reset -D qemu.log # -audiodev pa,id=speaker -machine pcspk-audiodev=speaker
|
||||
MOR_QEMUFLGS := -net none -netdev user,id=n0 -device rtl8139,netdev=n0 -serial file:serial.log
|
||||
SRC_DIRS := kernel drivers lib
|
||||
INCLUDE_DIRS := include
|
||||
@ -78,10 +79,10 @@ iso: $(TARGET)
|
||||
|
||||
# === Run in QEMU ===
|
||||
run: iso
|
||||
@if [ ! -f espresso.img ]; then \
|
||||
@if [ ! -f $(FAT16_DISK) ]; then \
|
||||
$(QEMU_MKE_IMG); \
|
||||
sudo mkfs.fat $(MKFS_FLAGS) espresso.img; \
|
||||
fi
|
||||
sudo mkfs.fat $(MKFS_FLAGS) espresso.img
|
||||
@echo
|
||||
qemu-system-i386 $(QEMUFLAGS) $(QEMUFLGS_EXT) $(MOR_QEMUFLGS)
|
||||
|
||||
@ -90,6 +91,17 @@ run: iso
|
||||
clean:
|
||||
rm -f $(INTERNAL_OBJS) $(TARGET) $(ISO)
|
||||
rm -rf $(ISO_DIR)
|
||||
|
||||
clean_disk:
|
||||
rm -f espresso.img
|
||||
|
||||
.PHONY: all clean iso run debug build buildc
|
||||
# === Push code to repo ===
|
||||
commit:
|
||||
ifndef MSG
|
||||
$(error MSG required)
|
||||
endif
|
||||
git add .
|
||||
git commit -m "$(MSG)"
|
||||
git push
|
||||
|
||||
.PHONY: all clean clean_disk iso run debug build buildc
|
||||
|
||||
Reference in New Issue
Block a user