From 8b952fb86fac53d1a889e4d41e7d989db000c095 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 29 Aug 2025 11:46:32 +0200 Subject: [PATCH] edit makefile to remove redundant flags, and make clean task more conditional --- makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 6092ad6..7751663 100644 --- a/makefile +++ b/makefile @@ -9,15 +9,13 @@ VERSION = 0.0.0 DEBUG ?= 0 CC ?= cc LD ?= ld -CFLAGS += -c -std=gnu99 -Wall -MMD -MP -CFLAGS += -Ilib/glad/include LDFLAGS += -flto -lm MARCH ?= $(shell uname -m) KERNEL ?= $(shell uname -s | tr '[:upper:]' '[:lower:]') # compilation flags -CFLAGS = -c -std=gnu99 -Wall -Wextra -Wpedantic -MMD -MP -LDFLAGS = -flto +CFLAGS += -c -std=gnu99 -Wall -Wextra -Wpedantic -MMD -MP +LDFLAGS += -flto # architecture/OS detection ifeq ($(KERNEL),) @@ -81,8 +79,8 @@ compile: $(BIN) .PHONY .NOTPARALLEL: clean: - @rm -rv obj/ - @rm -rv bin/ + @[ -d obj/ ] && rm -rv obj/ || true + @[ -d bin/ ] && rm -rv bin/ || true $(BIN): $(OBJ) $(info [CC/LD] $@)