Makefile: DEBUG option (#86)

* Makefile: DEBUG option

* diff_settings.py: if diffing with --source, make DEBUG=1

Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
Erin Moon 2021-01-18 13:16:09 -06:00 committed by GitHub
parent c70d485d35
commit caeacbe56b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,16 @@
WINDOWS := $(shell which wine ; echo $$?)
UNAME_S := $(shell uname -s)
#-------------------------------------------------------------------------------
# Options
#-------------------------------------------------------------------------------
DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g
else
CFLAGS +=
endif
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
@ -53,6 +63,7 @@ endif
AS := $(DEVKITPPC)/bin/powerpc-eabi-as
OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy
STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
ELF2DOL := tools/elf2dol
@ -71,7 +82,7 @@ ASFLAGS := -mgekko -I include
LDFLAGS := -map $(MAP) -fp hard -nodefaults -w off
# Compiler flags
CFLAGS := -Cpp_exceptions off -proc gekko -fp hard -O3 -nodefaults -msgstyle gcc -enum int $(INCLUDES)
CFLAGS += -Cpp_exceptions off -proc gekko -fp hard -O3 -nodefaults -msgstyle gcc -enum int $(INCLUDES)
# for postprocess.py
PROCFLAGS := -fprologue-fixup=old_stack

View File

@ -11,6 +11,8 @@ def apply(config, args):
config['myimg'] = 'build/dolzel2/main.elf'
config['baseimg'] = 'baserom.elf'
config['makeflags'] = []
if args.source:
config['makeflags'].append('DEBUG=1')
config['source_directories'] = ['src', 'libs', 'include']
config['arch'] = 'ppc'
config['objdump_executable'] = f"{os.environ['DEVKITPPC']}/bin/powerpc-eabi-objdump"