Make building with debug symbols conditional in the Makefile

This commit is contained in:
apio 2022-09-07 15:05:57 +02:00
parent c2391cee5d
commit 0cc3900e88
2 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,7 @@ CXX := x86_64-elf-g++
AS := x86_64-elf-as AS := x86_64-elf-as
NASM := nasm NASM := nasm
CFLAGS := -g -Wall -Wextra -Werror -Os -ffreestanding -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fshort-wchar -mcmodel=kernel -I$(MOON_DIR)/include -isystem $(MOON_DIR)/include/std CFLAGS := -Wall -Wextra -Werror -Os -ffreestanding -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fshort-wchar -mcmodel=kernel -I$(MOON_DIR)/include -isystem $(MOON_DIR)/include/std
CXXFLAGS := -fno-rtti -fno-exceptions CXXFLAGS := -fno-rtti -fno-exceptions
NASMFLAGS := -felf64 NASMFLAGS := -felf64
ASFLAGS := ASFLAGS :=
@ -18,6 +18,10 @@ ifneq ($(MOON_BUILD_STABLE), 1)
CFLAGS := ${CFLAGS} -D_MOON_SUFFIX="$(shell git rev-parse --short HEAD)" CFLAGS := ${CFLAGS} -D_MOON_SUFFIX="$(shell git rev-parse --short HEAD)"
endif endif
ifeq ($(MOON_BUILD_DEBUG), 1)
CFLAGS := -ggdb ${CFLAGS}
endif
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
CXX_SRC = $(call rwildcard,$(MOON_SRC),*.cpp) CXX_SRC = $(call rwildcard,$(MOON_SRC),*.cpp)

View File

@ -3,6 +3,6 @@
set -e set -e
source $(dirname $0)/env.sh source $(dirname $0)/env.sh
tools/build-iso.sh MOON_BUILD_DEBUG=1 tools/rebuild-iso.sh
qemu-system-x86_64 -cdrom Luna.iso -smp 1 -m 256M -serial stdio -d int,cpu_reset -s -no-reboot $@ qemu-system-x86_64 -cdrom Luna.iso -smp 1 -m 256M -serial stdio -d int,cpu_reset -s -no-reboot $@