diff --git a/.github/workflows/3DS.yml b/.github/workflows/3DS.yml new file mode 100644 index 0000000000..cd046d7694 --- /dev/null +++ b/.github/workflows/3DS.yml @@ -0,0 +1,39 @@ +name: CI 3DS + +on: + push: + pull_request: + repository_dispatch: + types: [run_build] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + container: + image: git.libretro.com:5050/libretro-infrastructure/libretro-build-devkitpro:latest + options: --user root + + steps: + - uses: actions/checkout@v3 + + - name: Compile Salamander + run: | + make -f Makefile.ctr.salamander -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 clean + make -f Makefile.ctr.salamander -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 + + - name: Compile RA + run: | + make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 clean + make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 HAVE_STATIC_DUMMY=1 + - name: Get short SHA + id: slug + run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + + - uses: actions/upload-artifact@v3 + with: + name: RA-3DS-dummy-${{ steps.slug.outputs.sha8 }} + path: | + retroarch_3ds.cia diff --git a/Makefile.ctr b/Makefile.ctr index 51793e6222..06fd809911 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -4,6 +4,7 @@ LIBRETRO = DEBUG = 0 CONSOLE_LOG = 0 GRIFFIN_BUILD = 1 +HAVE_STATIC_DUMMY ?= 0 WHOLE_ARCHIVE_LINK = 0 BUILD_3DSX = 1 BUILD_3DS = 0 @@ -152,13 +153,13 @@ LIBDIRS := -L. -L$(CTRULIB)/lib ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft -CFLAGS += -mword-relocations \ - -fomit-frame-pointer -ffast-math \ - -Werror=implicit-function-declaration \ - $(ARCH) +CFLAGS += -mword-relocations \ + -fomit-frame-pointer -ffast-math \ + -Werror=implicit-function-declaration \ + $(ARCH) #CFLAGS += -Wall -CFLAGS += -DARM11 -D_3DS +CFLAGS += -DARM11 -D_3DS ifeq ($(strip $(USE_CTRULIB_2)),1) CFLAGS += -D__3DS__ @@ -184,12 +185,12 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1) endif CFLAGS += -I. \ - -Ideps \ - -Ideps/7zip \ - -Ideps/stb \ - -Ideps/rcheevos/include \ - -Ilibretro-common/include \ - -Ilibretro-common/include/compat/zlib + -Ideps \ + -Ideps/7zip \ + -Ideps/stb \ + -Ideps/rcheevos/include \ + -Ilibretro-common/include \ + -Ilibretro-common/include/compat/zlib CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE CFLAGS += -DHAVE_DSP_FILTER @@ -197,14 +198,23 @@ CFLAGS += -DHAVE_VIDEO_FILTER CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES) CFLAGS += -DHAVE_CHEATS -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 - -ASFLAGS := -g $(ARCH) -O3 -LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 +ASFLAGS := -g $(ARCH) -O3 +LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) CFLAGS += -std=gnu99 -ffast-math -LIBS := $(WHOLE_START) -lretro_ctr $(WHOLE_END) -lm +LIB_CORE := +LIB_CORE_FULL := + +ifeq ($(HAVE_STATIC_DUMMY),1) + DEFINES += -DHAVE_STATIC_DUMMY +else + LIB_CORE += -lretro_ctr + LIB_CORE_FULL += libretro_ctr.a +endif + +LIBS := $(WHOLE_START) $(LIB_CORE) $(WHOLE_END) -lm ifeq ($(DEBUG), 1) LIBS += -lctrud @@ -230,7 +240,7 @@ all: $(TARGET) $(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA) $(TARGET).3dsx: $(TARGET).elf -$(TARGET).elf: $(OBJ) libretro_ctr.a +$(TARGET).elf: $(OBJ) $(LIB_CORE_FULL) PREFIX := $(DEVKITARM)/bin/arm-none-eabi-