summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/Containerfile24
-rw-r--r--.devcontainer/devcontainer.json6
-rw-r--r--GBA.mk6
-rw-r--r--Toolchain.mk4
4 files changed, 36 insertions, 4 deletions
diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile
new file mode 100644
index 00000000..da259837
--- /dev/null
+++ b/.devcontainer/Containerfile
@@ -0,0 +1,24 @@
+FROM debian
+
+RUN apt update && apt upgrade -y && apt install -y --no-install-recommends \
+ ca-certificates \
+ cmake \
+ g++ \
+ gcc \
+ gcc-arm-none-eabi \
+ git \
+ libpng-dev \
+ make \
+ python3 \
+ python3-pycparser \
+ ssh-client \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN git clone https://github.com/pret/agbcc.git /agbcc
+
+RUN cd /agbcc && \
+ ./build.sh && \
+ mkdir -p /agbcc-install && \
+ ./install.sh /agbcc-install
+
+ENV AGBCC_PATH=/agbcc-install/tools/agbcc
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..52cc931e
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,6 @@
+{
+ "name": "zeldaret/tmc-dev",
+ "build": {
+ "dockerfile": "Containerfile"
+ }
+} \ No newline at end of file
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