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

nds-blocksds: Clean up/update Makefile, add GitHub CI support. #428

Merged
merged 2 commits into from
Apr 11, 2024
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,23 @@ jobs:
- name: Package NDS .zip
run: make archive

ARM-NDS-BlocksDS:
runs-on: ubuntu-latest
container: skylyrac/blocksds:slim-latest
steps:
- name: Install dependencies
run: apt update && apt install -y --no-install-recommends $MZXDEPS_DEBIAN_CROSS
- name: Install target dependencies
run: wf-pacman -Syu --noconfirm && wf-pacman -S --noconfirm toolchain-gcc-arm-none-eabi-zlib
- run: echo "BLOCKSDS=/opt/blocksds/core" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Configure NDS/BlocksDS
run: arch/nds-blocksds/CONFIG.NDS
- name: Build NDS/BlocksDS
run: $MZX_MAKE
- name: Package NDS/BlocksDS .zip
run: make archive

PowerPC-Wii:
runs-on: ubuntu-latest
container: devkitpro/devkitppc
Expand Down
28 changes: 12 additions & 16 deletions arch/nds-blocksds/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ EXTRA_INCLUDES := $(foreach path,$(EXTRA_LIBS_DIRS),-I$(path)/include)
EXTRA_LIBS := $(foreach path,$(EXTRA_LIBS_DIRS),-L$(path)/lib) \
-Wl,--start-group $(EXTRA_LIBS_NAMES) -Wl,--end-group

ARCH_CFLAGS += -marm -mthumb-interwork -mcpu=arm946e-s+nofp
ARCH_CFLAGS += ${EXTRA_INCLUDES} -DARM9 -D__NDS__ -Iarch/nds -ffunction-sections -fdata-sections
ARCH_CXXFLAGS += ${ARCH_CFLAGS}
ARCH_CFLAGS += -marm -mcpu=arm946e-s+nofp
ARCH_CFLAGS += ${EXTRA_INCLUDES} -Iarch/nds -ffunction-sections -fdata-sections

ARCH_LDFLAGS += -marm -mcpu=arm946e-s+nofp
ARCH_LDFLAGS += ${EXTRA_LIBS}

ARCH_LDFLAGS += -marm -mthumb-interwork -mcpu=arm946e-s+nofp
ARCH_LDFLAGS += -Wl,--defsym=vfprintf=__i_vfprintf -Wl,--defsym=vfscanf=__i_vfscanf
ARCH_LDFLAGS += -Wl,--no-warn-rwx-segments -Wl,--use-blx
ARCH_LDFLAGS += $(BLOCKSDS)/sys/crts/ds_arm9_crt0.o ${EXTRA_LIBS} -Wl,--gc-sections -nostdlib \
-T$(BLOCKSDS)/sys/crts/ds_arm9.mem \
-T$(BLOCKSDS)/sys/crts/ds_arm9.ld
ARCH_CFLAGS += -DPICOLIBC_LONG_LONG_PRINTF_SCANF -specs=$(BLOCKSDS)/sys/crts/ds_arm9.specs
ARCH_LDFLAGS += -DPICOLIBC_LONG_LONG_PRINTF_SCANF -specs=$(BLOCKSDS)/sys/crts/ds_arm9.specs
ARCH_CXXFLAGS += ${ARCH_CFLAGS}

ARM7_BINARY := arch/nds-blocksds/megazeux.arm7.elf

Expand Down Expand Up @@ -81,17 +80,14 @@ ARM7_LIBS := $(foreach path,$(ARM7_LIBS_DIRS),-L$(path)/lib) \

$(ARM7_BINARY): $(ARM7_OBJECT_FILES)
$(if ${V},,@echo " LD.7 " $@)
${CC} -o $@ $< $(BLOCKSDS)/sys/crts/ds_arm7_crt0.o \
-mthumb -mthumb-interwork -Wl,--gc-sections -nostdlib \
-T$(BLOCKSDS)/sys/crts/ds_arm7.ld \
-Wl,--start-group $(ARM7_LIBS) -Wl,--end-group \
-Wl,--no-warn-rwx-segments
${CC} -o $@ $< -mthumb -specs=$(BLOCKSDS)/sys/crts/ds_arm7.specs \
-Wl,--start-group $(ARM7_LIBS) -Wl,--end-group

arch/nds/arm7/source/%.c.o: arch/nds/arm7/source/%.c
$(if ${V},,@echo " CC.7 " $<)
${CC} -MD -Os -std=gnu11 -D__NDS__ -DARM7 \
${CC} -MD -Os -std=gnu11 -specs=$(BLOCKSDS)/sys/crts/ds_arm7.specs \
-Wall -Wno-unused-macros -mcpu=arm7tdmi \
-mthumb -mthumb-interwork $(ARM7_INCLUDES) \
-mthumb $(ARM7_INCLUDES) \
-ffunction-sections -fdata-sections -fomit-frame-pointer \
-c $< -o $@
#
Expand Down
Loading