restrcuct
This commit is contained in:
11
makefile
11
makefile
@@ -6,17 +6,17 @@ AS = $(CROSS)as
|
||||
LD = $(CROSS)ld
|
||||
OBJCOPY = $(CROSS)objcopy
|
||||
|
||||
CFLAGS = -O2 -ffreestanding -nostdlib -Wall -Wextra
|
||||
LDFLAGS = -T src/linker.ld
|
||||
CFLAGS = -O2 -ffreestanding -nostdlib -Wall -Wextra -Iinclude include/
|
||||
LDFLAGS = -T src/boot/linker.ld
|
||||
|
||||
SRC = src
|
||||
BUILD = build
|
||||
|
||||
# List all C source files here (update as needed)
|
||||
SOURCES_C = $(SRC)/renderer.c $(SRC)/font_pack.c $(SRC)/main.c
|
||||
SOURCES_C = $(SRC)/renderer.c $(SRC)/font_pack.c $(SRC)/main.c
|
||||
|
||||
# List assembler source files
|
||||
SOURCES_ASM = $(SRC)/boot.s
|
||||
SOURCES_ASM = $(SRC)/boot/boot.s
|
||||
|
||||
# Object files (one per source file)
|
||||
OBJ_C = $(patsubst $(SRC)/%.c,$(BUILD)/%.o,$(SOURCES_C))
|
||||
@@ -32,6 +32,7 @@ all: $(TARGET_IMG)
|
||||
# Create build directory if it does not exist
|
||||
$(BUILD):
|
||||
mkdir -p $(BUILD)
|
||||
mkdir -p $(BUILD)/boot
|
||||
|
||||
# Assemble assembly sources
|
||||
$(BUILD)/%.o: $(SRC)/%.s | $(BUILD)
|
||||
@@ -54,4 +55,4 @@ clean:
|
||||
|
||||
# Run QEMU emulator for Raspberry Pi 3 with serial output redirected to terminal
|
||||
run: $(TARGET_IMG)
|
||||
sudo qemu-system-aarch64 -M raspi3b -serial stdio -kernel $(TARGET_IMG)
|
||||
qemu-system-aarch64 -M raspi3b -serial stdio -kernel $(TARGET_IMG)
|
||||
|
||||
Reference in New Issue
Block a user