From 4a90d24069544f518d8f06f0eba2ec7bd4c7841c Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 25 Dec 2024 14:01:55 +0100 Subject: [PATCH] Makefile: debug is default target, make sure include path is set to project root, better clean --- Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 10c26a0..ad23202 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,21 @@ # SPDX-License-Identifier: MIT CC = gcc -CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter -CFLAGS += -Wno-unused-variable -Wno-unused-function +CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter +CFLAGS += -Wno-unused-variable -Wno-unused-function CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label CFLAGS += -Wno-unused-result -Wno-unused-const-variable -ifneq ($(DEBUG), 1) +CFLAGS += -I. + +ifneq ($(RELEASE), 1) +CFLAGS += -g -O0 -std=c99 -march=native -mtune=native +CFLAGS += -DDEBUG +else CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer CFLAGS += -fshort-enums -else -CFLAGS += -g -O0 -std=c99 -march=native -mtune=native -CFLAGS += -DDEBUG endif # DEBUG LDFLAGS = -lm @@ -50,7 +52,7 @@ install: @cp ringbuf.h /usr/local/include clean: - rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so + rm -f $(OBJECTS) $(ASMS) driver librbuf.a librbuf.so **/*.o **/*.elf asm: $(ASMS) $(OBJECTS) wc -l $(ASMS)