Misc. changes

use the TOOLCHAIN variable instead of overriding DEVKITARM
remove redunant DEBUG variable, substitute DINFO
This commit is contained in:
PikalaxALT 2019-06-29 18:32:04 -04:00
parent f9d8678db4
commit 8b73ba61ee
3 changed files with 18 additions and 14 deletions

View File

@ -109,8 +109,14 @@ This project supports the `arm-none-eabi-gcc` compiler which ships with devkitAR
# Building with your own toolchain # 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

View File

@ -1,7 +1,8 @@
ifneq (,$(wildcard $(DEVKITARM)/base_tools)) TOOLCHAIN := $(DEVKITARM)
include $(DEVKITARM)/base_tools ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
else else
PREFIX := $(DEVKITARM)/bin/arm-none-eabi- PREFIX := $(TOOLCHAIN)/bin/arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy OBJCOPY := $(PREFIX)objcopy
CC := $(PREFIX)gcc CC := $(PREFIX)gcc
AS := $(PREFIX)as 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 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 ROM := pokeemerald_modern.gba
OBJ_DIR := build/modern OBJ_DIR := build/modern
LIBPATH := -L $(DEVKITARM)/lib/gcc/arm-none-eabi/*/thumb -L $(DEVKITARM)/arm-none-eabi/lib/thumb LIBPATH := -L $(TOOLCHAIN)/lib/gcc/arm-none-eabi/*/thumb -L $(TOOLCHAIN)/arm-none-eabi/lib/thumb
endif
ifeq ($(DEBUG),1)
CFLAGS += -g
endif endif
CPPFLAGS := -iquote include -Wno-trigraphs -DMODERN=$(MODERN) CPPFLAGS := -iquote include -Wno-trigraphs -DMODERN=$(MODERN)
@ -123,7 +120,7 @@ compare: $(ROM)
clean: tidy clean: tidy
rm -f sound/direct_sound_samples/*.bin 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 {} + 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)/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 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: tidy:
rm -f $(ROM) $(ELF) $(MAP) rm -f $(ROM) $(ELF) $(MAP)
rm -r $(OBJ_DIR)
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
@$(MAKE) tidy MODERN=1 @$(MAKE) tidy MODERN=1
rm -r build/*
endif endif
include graphics_file_rules.mk include graphics_file_rules.mk

View File

@ -33,6 +33,7 @@
History History
------- -------
v1.07 - added support for ELF input, (PikalaxALT)
v1.06 - added output silencing, (Diegoisawesome) v1.06 - added output silencing, (Diegoisawesome)
v1.05 - added debug offset argument, (Diegoisawesome) v1.05 - added debug offset argument, (Diegoisawesome)
v1.04 - converted to plain C, (WinterMute) v1.04 - converted to plain C, (WinterMute)
@ -50,7 +51,7 @@
#include <stdint.h> #include <stdint.h>
#include "elf.h" #include "elf.h"
#define VER "1.06" #define VER "1.07"
#define ARGV argv[arg] #define ARGV argv[arg]
#define VALUE (ARGV+2) #define VALUE (ARGV+2)
#define NUMBER strtoul(VALUE, NULL, 0) #define NUMBER strtoul(VALUE, NULL, 0)