From 8b73ba61ee504cb8501b971eca21c74d3838e058 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 29 Jun 2019 18:32:04 -0400 Subject: [PATCH] Misc. changes use the TOOLCHAIN variable instead of overriding DEVKITARM remove redunant DEBUG variable, substitute DINFO --- INSTALL.md | 12 +++++++++--- Makefile | 17 +++++++---------- tools/gbafix/gbafix.c | 3 ++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 8825e49da..df7b28354 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -109,8 +109,14 @@ This project supports the `arm-none-eabi-gcc` compiler which ships with devkitAR # Building with your own toolchain -To build Pokemon Emerald with a toolchain other than devkitARM, override the `DEVKITARM` environment variable with the path to your toolchain. Example: +To build Pokemon Emerald with a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain. Example: - make compare DEVKITARM=/usr/local/arm-none-eabi + make compare TOOLCHAIN=/usr/local/arm-none-eabi -The path you pass to the `DEVKITARM` variable must contain the subdirectory `bin`. If you compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. +The path you pass to the `TOOLCHAIN` variable must contain the subdirectory `bin`. If you compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. + +# Building with debug info + +To build the ELF file with enhanced debug info, use the `DINFO` variable: + + make compare DINFO=1 diff --git a/Makefile b/Makefile index 326d81421..1cd5da85c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -ifneq (,$(wildcard $(DEVKITARM)/base_tools)) -include $(DEVKITARM)/base_tools +TOOLCHAIN := $(DEVKITARM) +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools else -PREFIX := $(DEVKITARM)/bin/arm-none-eabi- +PREFIX := $(TOOLCHAIN)/bin/arm-none-eabi- OBJCOPY := $(PREFIX)objcopy CC := $(PREFIX)gcc AS := $(PREFIX)as @@ -52,11 +53,7 @@ CC1 := $(shell $(PREFIX)gcc --print-prog-name=cc1) override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -quiet -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast ROM := pokeemerald_modern.gba OBJ_DIR := build/modern -LIBPATH := -L $(DEVKITARM)/lib/gcc/arm-none-eabi/*/thumb -L $(DEVKITARM)/arm-none-eabi/lib/thumb -endif - -ifeq ($(DEBUG),1) -CFLAGS += -g +LIBPATH := -L $(TOOLCHAIN)/lib/gcc/arm-none-eabi/*/thumb -L $(TOOLCHAIN)/arm-none-eabi/lib/thumb endif CPPFLAGS := -iquote include -Wno-trigraphs -DMODERN=$(MODERN) @@ -123,7 +120,7 @@ compare: $(ROM) clean: tidy rm -f sound/direct_sound_samples/*.bin - rm -f $(SONG_OBJS) $(MID_OBJS) $(MID_SUBDIR)/*.s + rm -f $(MID_SUBDIR)/*.s find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc @@ -132,9 +129,9 @@ clean: tidy tidy: rm -f $(ROM) $(ELF) $(MAP) + rm -r $(OBJ_DIR) ifeq ($(MODERN),0) @$(MAKE) tidy MODERN=1 - rm -r build/* endif include graphics_file_rules.mk diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c index 179305b1b..9088cdc5f 100644 --- a/tools/gbafix/gbafix.c +++ b/tools/gbafix/gbafix.c @@ -33,6 +33,7 @@ History ------- + v1.07 - added support for ELF input, (PikalaxALT) v1.06 - added output silencing, (Diegoisawesome) v1.05 - added debug offset argument, (Diegoisawesome) v1.04 - converted to plain C, (WinterMute) @@ -50,7 +51,7 @@ #include #include "elf.h" -#define VER "1.06" +#define VER "1.07" #define ARGV argv[arg] #define VALUE (ARGV+2) #define NUMBER strtoul(VALUE, NULL, 0)