a cow based x86_64 operating system, using limine and stivale2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

59 lines
1.3 KiB

KERNEL := ../disk_root/boot/kernel.elf
CC := x86_64-elf-gcc
ASM := nasm
ASM_FLAGS := -felf64
CFLAGS = -Wall -Wextra -O3 -pipe
INTERNALLDFLAGS := -Tlinker.ld \
-nostdlib \
-Wl,--export-dynamic \
-zmax-page-size=0x1000 \
-static \
-pie \
-ztext
# ,--dynamic-linker
INTERNALCFLAGS := -mgeneral-regs-only \
-ffreestanding \
-mno-red-zone \
-mno-80387 \
-fno-omit-frame-pointer \
-std=gnu11 \
-Wall -Wextra \
-fcompare-debug-second \
-I/opt/cross/include/ \
-fpie \
# -D BIGGER_FONT
CFILES := $(shell find ./ -type f -name '*.c')
SFILES := $(shell find ./ -type f -name '*.s')
OBJ := $(SFILES:.s=.s.o) $(CFILES:.c=.c.o)
LDSCRIPT := linker.ld
#charmap.bmp.o
.PHONY: all clean
all: $(KERNEL)
$(KERNEL): $(OBJ) $(LDSCRIPT)
$(CC) $(INTERNALLDFLAGS) $(OBJ) -o $@
#%.bmp.o: ../resources/bmp/%.bmp
# $(LD) -r -b binary -o $@ $<
#%.txt.o: ../resources/ascii/%.txt
# $(LD) -r -b binary -o $@ $<
kernel/memory/paging.o: INTERNALCFLAGS += -Wno-int-conversion
%.c.o: %.c
$(CC) $(CFLAGS) $(INTERNALCFLAGS) -c $< -o $@
%.s.o: %.s
$(ASM) $(ASM_FLAGS) $< -o $@
clean:
rm -rf $(KERNEL) $(OBJ)