commit 514810dad8832a71be788e671fa8f6311374e5a0 parent cedb45a57fb1989768dcd09cf7f142628860e911 Author: bsandro <email@bsandro.tech> Date: Wed, 10 Dec 2025 20:20:59 +0200 Support for DEBUG=1 in Makefile Diffstat:
| M | Makefile | | | 12 | +++++++++--- |
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,15 +1,21 @@ .SUFFIXES: MAKEFLAGS+=-rR -CFLAGS=-O3 -std=c99 -Werror -Wall -Wextra -ffast-math -I. +CFLAGS=-std=c99 -Werror -Wall -Wextra -I. +ifeq ($(DEBUG),1) +CFLAGS+=-O0 -g +else +CFLAGS+=-O3 -ffast-math +LTO=-flto +endif UNAME:=$(shell uname -m) ifeq ($(UNAME),riscv64) CFLAGS+=-mtune=sifive-u74 else ifeq ($(UNAME),Power Macintosh) -CFLAGS+=-mtune=native -flto +CFLAGS+=-mtune=native $(LTO) else ifeq ($(UNAME),i386) CFLAGS+=-mtune=native else -CFLAGS+=-march=native -flto +CFLAGS+=-march=native $(LTO) endif LDFLAGS=-lc -lm