Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jun 6, 2024
1 parent 245a163 commit dc8d31b
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 6 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_macclassic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build latest (Mac Classic)
on: [push]

concurrency:
group: ${{ github.ref }}-mac-classic
cancel-in-progress: true

jobs:
build-mac-classic:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: ghcr.io/autc04/retro68
steps:
- uses: actions/checkout@v4
- name: Compile Mac classic build
id: compile
run: |
make macclassic_68k RETRO68=/Retro68-build/toolchain
make macclassic_ppc RETRO68=/Retro68-build/toolchain
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile Mac Classic build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'


- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-68k.dsk'
DEST_NAME: 'ClassiCube-68k.dsk'

- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-ppc.dsk'
DEST_NAME: 'ClassiCube-ppc.dsk'
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ifeq ($(PLAT),sunos)
endif

ifeq ($(PLAT),darwin)
OBJECTS += $(BUILD_DIR)/interop_cocoa.o
OBJECTS += $(BUILD_DIR)/Window_cocoa.o
CFLAGS = -g -pipe -fno-math-errno -DCC_BUILD_ICON
LIBS =
LDFLAGS = -rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
Expand Down Expand Up @@ -79,14 +79,14 @@ ifeq ($(PLAT),dragonfly)
endif

ifeq ($(PLAT),haiku)
OBJECTS += $(BUILD_DIR)/interop_BeOS.o
OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o
CFLAGS = -g -pipe -fno-math-errno
LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
endif

ifeq ($(PLAT),beos)
OBJECTS += $(BUILD_DIR)/interop_BeOS.o
OBJECTS += $(BUILD_DIR)/Platform_BeOS.o $(BUILD_DIR)/Window_BeOS.o
CFLAGS = -g -pipe
LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
Expand All @@ -102,10 +102,20 @@ ifeq ($(PLAT),irix)
LIBS = -lGL -lX11 -lXi -lpthread -ldl
endif


ifeq ($(OS),Windows_NT)
DEL = del
endif

ifdef SDL2
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL2
LIBS += -lSDL2
endif
ifdef SDL3
CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_SDL3
LIBS += -lSDL3
endif

default: $(PLAT)

web:
Expand Down Expand Up @@ -134,8 +144,12 @@ serenityos:
$(MAKE) $(ENAME) PLAT=serenityos
irix:
$(MAKE) $(ENAME) PLAT=irix
sdl2:
$(MAKE) $(ENAME) SDL2=1
sdl3:
$(MAKE) $(ENAME) SDL3=1

# consoles builds require special handling, so are moved to
# Some builds require more complex handling, so are moved to
# separate makefiles to avoid having one giant messy makefile
dreamcast:
$(MAKE) -f misc/dreamcast/Makefile
Expand Down Expand Up @@ -172,6 +186,10 @@ switch:
$(MAKE) -f misc/switch/Makefile
os/2:
$(MAKE) -f misc/os2/Makefile
macclassic_68k:
$(MAKE) -f misc/macclassic/Makefile_68k
macclassic_ppc:
$(MAKE) -f misc/macclassic/Makefile_ppc

clean:
$(DEL) $(OBJECTS)
Expand Down Expand Up @@ -201,8 +219,8 @@ $(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c
endif

# === Platform specific file compiling ===
$(BUILD_DIR)/interop_cocoa.o: $(SOURCE_DIR)/interop_cocoa.m
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.m
$(CC) $(CFLAGS) -c $< -o $@

$(BUILD_DIR)/interop_BeOS.o: $(SOURCE_DIR)/interop_BeOS.cpp
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
23 changes: 23 additions & 0 deletions misc/macclassic/68APPL.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "Processes.r"
#include "Retro68.r"

resource 'SIZE' (-1) {
reserved,
ignoreSuspendResumeEvents,
reserved,
cannotBackground,
needsActivateOnFGSwitch,
backgroundAndForeground,
dontGetFrontClicks,
ignoreChildDiedEvents,
is32BitCompatible,
notHighLevelEventAware,
onlyLocalHLEvents,
notStationeryAware,
dontUseTextEditServices,
reserved,
reserved,
reserved,
3072 * 1024,
8192 * 1024
};
36 changes: 36 additions & 0 deletions misc/macclassic/Makefile_68k
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# path to RETRO68
RETRO68=../Retro68-build/toolchain

PREFIX=$(RETRO68)/m68k-apple-macos
CC=$(RETRO68)/bin/m68k-apple-macos-gcc
CXX=$(RETRO68)/bin/m68k-apple-macos-g++
CFLAGS=-O1 -fno-math-errno

REZ=$(RETRO68)/bin/Rez

LDFLAGS=-lRetroConsole
RINCLUDES=$(PREFIX)/RIncludes
REZFLAGS=-I$(RINCLUDES)

TARGET := ClassiCube-68k
BUILD_DIR := build-68k
SOURCE_DIR := src
C_SOURCES := $(wildcard $(SOURCE_DIR)/*.c)
C_OBJECTS := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))

$(TARGET).bin $(TARGET).APPL $(TARGET).dsk: $(BUILD_DIR) $(TARGET).code.bin
$(REZ) $(REZFLAGS) \
--copy "$(TARGET).code.bin" \
"misc/macclassic/68APPL.r" \
-t "APPL" -c "????" \
-o $(TARGET).bin --cc $(TARGET).APPL --cc $(TARGET).dsk


$(TARGET).code.bin: $(C_OBJECTS)
$(CXX) $(C_OBJECTS) -o $@ $(LDFLAGS) # C++ used for linking because RetroConsole needs it

$(BUILD_DIR):
mkdir -p $(BUILD_DIR)

$(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
39 changes: 39 additions & 0 deletions misc/macclassic/Makefile_ppc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# path to RETRO68
RETRO68=../Retro68-build/toolchain

PREFIX=$(RETRO68)/powerpc-apple-macos
CC=$(RETRO68)/bin/powerpc-apple-macos-gcc
CXX=$(RETRO68)/bin/powerpc-apple-macos-g++
CFLAGS=-O1 -fno-math-errno

REZ=$(RETRO68)/bin/Rez
MakePEF=$(RETRO68)/bin/MakePEF

LDFLAGS=-lRetroConsole
RINCLUDES=$(PREFIX)/RIncludes
REZFLAGS=-I$(RINCLUDES)

TARGET := ClassiCube-ppc
BUILD_DIR := build-ppc
SOURCE_DIR := src
C_SOURCES := $(wildcard $(SOURCE_DIR)/*.c)
C_OBJECTS := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))

$(TARGET).bin $(TARGET).APPL $(TARGET).dsk: $(BUILD_DIR) $(TARGET).pef
$(REZ) $(REZFLAGS) \
"misc/macclassic/ppcAPPL.r" \
-t "APPL" -c "????" \
--data $(TARGET).pef \
-o $(TARGET).bin --cc $(TARGET).APPL --cc $(TARGET).dsk

$(TARGET).elf: $(C_OBJECTS)
$(CXX) $(C_OBJECTS) -o $@ $(LDFLAGS) # C++ used for linking because RetroConsole needs it

$(TARGET).pef: $(TARGET).elf
$(MakePEF) $(TARGET).elf -o $(TARGET).pef

$(BUILD_DIR):
mkdir -p $(BUILD_DIR)

$(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
32 changes: 32 additions & 0 deletions misc/macclassic/ppcAPPL.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "Processes.r"
#include "CodeFragments.r"

resource 'cfrg' (0) {
{
kPowerPCCFragArch, kIsCompleteCFrag, kNoVersionNum, kNoVersionNum,
kDefaultStackSize, kNoAppSubFolder,
kApplicationCFrag, kDataForkCFragLocator, kZeroOffset, kCFragGoesToEOF,
"ClassiCube"
}
};

resource 'SIZE' (-1) {
reserved,
ignoreSuspendResumeEvents,
reserved,
cannotBackground,
needsActivateOnFGSwitch,
backgroundAndForeground,
dontGetFrontClicks,
ignoreChildDiedEvents,
is32BitCompatible,
notHighLevelEventAware,
onlyLocalHLEvents,
notStationeryAware,
dontUseTextEditServices,
reserved,
reserved,
reserved,
8192 * 1024,
8192 * 1024
};

0 comments on commit dc8d31b

Please sign in to comment.