From 68d12d86d286b99737a67ce0ced4d088155bb91f Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Tue, 1 Feb 2022 18:14:11 +0100 Subject: [PATCH] Makefile refactor --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f5935b7..55e68b8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ -C_SOURCES = $(wildcard kernel/*.c drivers/*.c lib/*.c) -HEADERS = $(wildcard kernel/*.h drivers/*.h lib/*.h) -OBJ = $(C_SOURCES:.c=.o) +CC = gcc +CFLAGS = -fno-pie -m32 -Os -ffreestanding + +C_SOURCES = $(wildcard kernel/*.c drivers/*.c lib/*.c) +HEADERS = $(wildcard kernel/*.h drivers/*.h lib/*.h) +OBJ = $(C_SOURCES:.c=.o) all: eos.iso @@ -27,7 +30,7 @@ kernel.bin: kernel/kernel_entry.o kernel/enable_paging.o $(OBJ) %.o : %.c ${HEADERS} - gcc -fno-pie -m32 -Os -ffreestanding -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ %.o : %.asm nasm $< -f elf -o $@