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.
 
 
 
 
 

54 lines
773 B

.PHONY: all clean debug release
BIN_FILE:=blib.a
CC := x86_64-elf-gcc
AR := x86_64-elf-ar
LD := x86_64-elf-ld
ASM:=nasm
CFLAGS := -O3 -mgeneral-regs-only -Wall -Wextra \
-ffreestanding -Iinclude/ -fno-pie -fno-stack-protector -fno-pic
LDFLAGS := -shared -fno-pie -fno-pic
ARFLAGS:=rc
ASM_FLAGS := -felf64
CFILES :=$(shell find src -name "*.c")
SFILES :=$(shell find src -name "*.s")
OBJ := $(SFILES:.s=.s.o) \
$(CFILES:.c=.c.o)
debug: CFLAGS += -g
debug: LDFLAGS += -g
debug: all
release: all
all: $(BIN_FILE)
%.c.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.s.o: %.s
$(ASM) $(ASM_FLAGS) $< -o $@
$(BIN_FILE): $(OBJ)
# $(LD) $(LDFLAGS) $(OBJ) -o $(BIN_FILE)
$(AR) $(ARFLAGS) $(BIN_FILE) $(OBJ)
# ranlib $(BIN_FILE)
clean:
rm -rf $(OBJ) *.a *.elf