summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenny022p <info@henny022.de>2025-01-07 22:55:46 +0100
committerHenny022p <info@henny022.de>2025-01-07 22:55:46 +0100
commit121b8c3e4683832f71515c93db6e9395c1a096c8 (patch)
tree77c9ed2fc35e2048c73e96cdb4f42780bde0a33e
parentcd2b8d4b531ee5b4b78d04964a3f895edc31db73 (diff)
introduce AGBCC_PATH config variable
-rw-r--r--GBA.mk6
-rw-r--r--Toolchain.mk4
2 files changed, 6 insertions, 4 deletions
diff --git a/GBA.mk b/GBA.mk
index 87048ef9..9039bd8a 100644
--- a/GBA.mk
+++ b/GBA.mk
@@ -95,7 +95,7 @@ $(BUILD_DIR)/%.o: %.s $$(deps) $(ENUM_ASM_HEADERS)
$(BUILD_DIR)/enum_include/%.inc: include/%.h
@mkdir -p $(dir $@)
- $(ENUM_PROCESSOR) $< $(CC) "-D__attribute__(x)=" "-D$(GAME_VERSION)" "-E" "-nostdinc" "-Itools/agbcc" "-Itools/agbcc/include" "-iquote include" > $@
+ $(ENUM_PROCESSOR) $< $(CC) "-D__attribute__(x)=" "-D$(GAME_VERSION)" "-E" "-nostdinc" "-I$(AGBCC_PATH)" "-I$(AGBCC_PATH)/include" "-iquote include" > $@
# =============
# build C files
@@ -103,7 +103,7 @@ $(BUILD_DIR)/enum_include/%.inc: include/%.h
# agbcc includes are separate because we don't want dependency scanning on them
CINCLUDE := -I include -I $(BUILD_DIR)
-CPPFLAGS := -I tools/agbcc -I tools/agbcc/include $(CINCLUDE) -nostdinc -undef -D$(GAME_VERSION) -DREVISION=$(REVISION) -D$(GAME_LANGUAGE)
+CPPFLAGS := -I $(AGBCC_PATH) -I $(AGBCC_PATH)/include $(CINCLUDE) -nostdinc -undef -D$(GAME_VERSION) -DREVISION=$(REVISION) -D$(GAME_LANGUAGE)
CFLAGS := -O2 -Wimplicit -Wparentheses -Werror -Wno-multichar -g3
interwork := $(BUILD_DIR)/src/interrupts.o \
@@ -131,7 +131,7 @@ $(BUILD_DIR)/%.o : %.c $$(deps)
# ==============
LDFLAGS = -Map ../../$(BUILD_DIR)/$(BUILD_NAME).map
-LIB := -L ../../tools/agbcc/lib -lc
+LIB := -L $(AGBCC_PATH)/lib -lc
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
diff --git a/Toolchain.mk b/Toolchain.mk
index 76e2a871..8c695da4 100644
--- a/Toolchain.mk
+++ b/Toolchain.mk
@@ -28,7 +28,9 @@ OBJCOPY := $(TOOLCHAIN_PATH)arm-none-eabi-objcopy
# custom tools
# ============
-CC1 := tools/agbcc/bin/agbcc
+AGBCC_PATH ?= $(shell pwd)/tools/agbcc
+
+CC1 := $(AGBCC_PATH)/bin/agbcc
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
SCANINC := tools/bin/scaninc