edit makefile to remove redundant flags, and make clean task more conditional

This commit is contained in:
2025-08-29 11:46:32 +02:00
parent 0baadfca75
commit 8b952fb86f

View File

@@ -9,15 +9,13 @@ VERSION = 0.0.0
DEBUG ?= 0 DEBUG ?= 0
CC ?= cc CC ?= cc
LD ?= ld LD ?= ld
CFLAGS += -c -std=gnu99 -Wall -MMD -MP
CFLAGS += -Ilib/glad/include
LDFLAGS += -flto -lm LDFLAGS += -flto -lm
MARCH ?= $(shell uname -m) MARCH ?= $(shell uname -m)
KERNEL ?= $(shell uname -s | tr '[:upper:]' '[:lower:]') KERNEL ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
# compilation flags # compilation flags
CFLAGS = -c -std=gnu99 -Wall -Wextra -Wpedantic -MMD -MP CFLAGS += -c -std=gnu99 -Wall -Wextra -Wpedantic -MMD -MP
LDFLAGS = -flto LDFLAGS += -flto
# architecture/OS detection # architecture/OS detection
ifeq ($(KERNEL),) ifeq ($(KERNEL),)
@@ -81,8 +79,8 @@ compile: $(BIN)
.PHONY .NOTPARALLEL: .PHONY .NOTPARALLEL:
clean: clean:
@rm -rv obj/ @[ -d obj/ ] && rm -rv obj/ || true
@rm -rv bin/ @[ -d bin/ ] && rm -rv bin/ || true
$(BIN): $(OBJ) $(BIN): $(OBJ)
$(info [CC/LD] $@) $(info [CC/LD] $@)