From 07af47eca912f3b56f013749a268718d78656961 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 26 Aug 2021 20:41:45 +0300 Subject: Added debug flags and simple debug serial driver --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5097ff0..187c269 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ DO != echo > deps.mk -CFLAGS = -fno-pie -ggdb3 -ffreestanding -nostdlib -std=c11 -Wall -Wextra -mcmodel=medany +DEBUGFLAGS != [ $(DEBUG) ] && echo "-g3 -DDEBUG" || echo "-O2" +CFLAGS = -fno-pie -ffreestanding -nostdlib -std=c11 -Wall -Wextra DEPFLAGS = -MT $@ -MMD -MP -MF $@.d all: apos.bin @@ -26,8 +27,8 @@ include arch/$(ARCH)/source.mk INCLUDE_FLAGS := -I include -I arch/$(ARCH)/include\ -include config.h -include arch/$(ARCH)/config.h -COMPILE = $(CROSS_COMPILE)$(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDE_FLAGS) -GENELF = $(CROSS_COMPILE)$(CC) $(CFLAGS) $(INCLUDE_FLAGS) +COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS) $(CFLAGS) $(ARCH_FLAGS) $(DEPFLAGS) $(INCLUDE_FLAGS) +GENELF = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS) $(CFLAGS) $(ARCH_FLAGS) $(INCLUDE_FLAGS) GENLINK = $(CROSS_COMPILE)$(CPP) $(DEPFLAGS) $(INCLUDE_FLAGS) STRIPLINK = sed -n '/^[^\#]/p' -- cgit v1.3