mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
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:
@@ -1,6 +1,16 @@
|
|||||||
WINDOWS := $(shell which wine ; echo $$?)
|
WINDOWS := $(shell which wine ; echo $$?)
|
||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Options
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
DEBUG ?= 0
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
CFLAGS += -g
|
||||||
|
else
|
||||||
|
CFLAGS +=
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Files
|
# Files
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@@ -53,6 +63,7 @@ endif
|
|||||||
|
|
||||||
AS := $(DEVKITPPC)/bin/powerpc-eabi-as
|
AS := $(DEVKITPPC)/bin/powerpc-eabi-as
|
||||||
OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy
|
OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy
|
||||||
|
STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip
|
||||||
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
|
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
|
||||||
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
|
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
|
||||||
ELF2DOL := tools/elf2dol
|
ELF2DOL := tools/elf2dol
|
||||||
@@ -71,7 +82,7 @@ ASFLAGS := -mgekko -I include
|
|||||||
LDFLAGS := -map $(MAP) -fp hard -nodefaults -w off
|
LDFLAGS := -map $(MAP) -fp hard -nodefaults -w off
|
||||||
|
|
||||||
# Compiler flags
|
# 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
|
# for postprocess.py
|
||||||
PROCFLAGS := -fprologue-fixup=old_stack
|
PROCFLAGS := -fprologue-fixup=old_stack
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ def apply(config, args):
|
|||||||
config['myimg'] = 'build/dolzel2/main.elf'
|
config['myimg'] = 'build/dolzel2/main.elf'
|
||||||
config['baseimg'] = 'baserom.elf'
|
config['baseimg'] = 'baserom.elf'
|
||||||
config['makeflags'] = []
|
config['makeflags'] = []
|
||||||
|
if args.source:
|
||||||
|
config['makeflags'].append('DEBUG=1')
|
||||||
config['source_directories'] = ['src', 'libs', 'include']
|
config['source_directories'] = ['src', 'libs', 'include']
|
||||||
config['arch'] = 'ppc'
|
config['arch'] = 'ppc'
|
||||||
config['objdump_executable'] = f"{os.environ['DEVKITPPC']}/bin/powerpc-eabi-objdump"
|
config['objdump_executable'] = f"{os.environ['DEVKITPPC']}/bin/powerpc-eabi-objdump"
|
||||||
|
|||||||
Reference in New Issue
Block a user