Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Devcontainer configuration for easy development start #696

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM debian

RUN apt update && apt upgrade && 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/*

ADD 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
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "zeldaret/tmc-dev",
"build": {
"dockerfile": "Containerfile"
}
}
6 changes: 3 additions & 3 deletions GBA.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ $(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
# =============

# 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 \
Expand Down Expand Up @@ -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 $< $@
Expand Down
4 changes: 3 additions & 1 deletion Toolchain.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading