Skip to content

Commit 01da51c

Browse files
committed
Create ci.yml github workflow to build artifacts for PR
1 parent 0dcf479 commit 01da51c

File tree

8 files changed

+136
-38
lines changed

8 files changed

+136
-38
lines changed

.github/.dir-locals.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
((fundamental-mode . ((indent-tabs-mode . nil))))

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform:
15+
- adam
16+
- apple2
17+
- atari
18+
- c64
19+
- coco
20+
# - msdos # MSDOS doesn't seem to build yet
21+
22+
container:
23+
image: fozztexx/defoogi:1.4.1
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Build
29+
run: make -f Makefile.${{ matrix.platform }} r2r
30+
31+
- name: Upload artifact for ${{ matrix.platform }}
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: ${{ matrix.platform }}
35+
path: r2r/${{ matrix.platform }}/**

Makefile.adam

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ TARGET_EXEC ?= autorun.ddp
22

33
BUILD_DIR ?= ./build
44
SRC_DIRS ?= ./src
5+
R2R_DIR ?= ./r2r/adam
6+
R2R_BIN := $(R2R_DIR)/$(TARGET_EXEC)
57

68
ADDL_DIR1 := ../eoslib/src
79
ADDL_DIR2 := ../smartkeyslib/src
810

9-
ADDL_LIB1 := ../eoslib/eos.lib
10-
ADDL_LIB2 := ../smartkeyslib/smartkeys.lib
11+
ADDL_LIB1 := eos.lib
12+
ADDL_LIB2 := smartkeys.lib
1113

1214
CC=zcc
1315
AS=zcc
@@ -17,15 +19,22 @@ OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
1719
DEPS := $(OBJS:.o=.d)
1820

1921
CFLAGS=+coleco -subtype=adam -DBUILD_ADAM -I$(ADDL_DIR1) -I$(ADDL_DIR2)
20-
LDFLAGS=+coleco -subtype=adam -create-app -o$(TARGET_EXEC) -lndos -l$(ADDL_LIB1) -l$(ADDL_LIB2)
22+
LDFLAGS=+coleco -subtype=adam -create-app -lndos -l$(ADDL_LIB1) -l$(ADDL_LIB2)
2123
ASFLAGS=+coleco -subtype=adam
2224

2325
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
2426
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
2527

26-
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
27-
$(CC) $(LDFLAGS) $(OBJS)
28-
cp autorun.ddp ../fujinet-firmware/data/webui/device_specific/BUILD_ADAM/
28+
$(R2R_BIN): $(OBJS) | $(R2R_DIR)
29+
$(CC) -o$@ $(LDFLAGS) $(OBJS)
30+
31+
.PHONY: dist autorun clean r2r
32+
33+
dist: $(R2R_BIN)
34+
cp $< ../fujinet-platformio/data/webui/device_specific/BUILD_ADAM/
35+
36+
# Create the "Ready 2 Run" executable/disk
37+
r2r: $(R2R_BIN)
2938

3039
# c source
3140
$(BUILD_DIR)/%.c.o: %.c
@@ -37,10 +46,11 @@ $(BUILD_DIR)/%.asm.o: %.asm
3746
$(MKDIR_P) $(dir $@)
3847
$(AS) $(ASFLAGS) -c $< -o $@
3948

40-
.PHONY: clean
49+
$(R2R_DIR):
50+
$(MKDIR_P) $@
4151

4252
clean:
43-
$(RM) -r autorun* $(BUILD_DIR)
53+
$(RM) -r autorun* $(BUILD_DIR) $(R2R_DIR)
4454

4555
-include $(DEPS)
4656

Makefile.apple2

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ FUJINET_LIB_VERSION_DIR = $(FUJINET_LIB)/$(FUJINET_LIB_VERSION)-$(TARGETS)
1717
# Name of the final, single-file executable.
1818
# Default: name of the current dir with target name appended
1919
PROGRAM := config
20+
R2R_DIR := r2r/$(TARGETS)
21+
DISK := $(R2R_DIR)/autorun.po
2022

2123
# Path(s) to additional libraries required for linking the program
2224
# Use only if you don't want to place copies of the libraries in SRCDIR
@@ -256,7 +258,7 @@ ASFLAGS += --asm-include-dir src/$(TARGETLIST)/asminc --asm-include-dir $(FUJINE
256258
CFLAGS += --include-dir $(FUJINET_LIB_VERSION_DIR) -DUSING_FUJINET_LIB
257259

258260
.SUFFIXES:
259-
.PHONY: all test clean get_fujinet_lib zap love
261+
.PHONY: all test clean get_fujinet_lib zap love dist r2r
260262

261263
all: get_fujinet_lib $(PROGRAM)
262264

@@ -316,6 +318,9 @@ get_fujinet_lib:
316318
$(TARGETOBJDIR):
317319
$(call MKDIR,$@)
318320

321+
$(R2R_DIR):
322+
$(call MKDIR,$@)
323+
319324
vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
320325

321326
$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR)
@@ -344,24 +349,29 @@ test: $(PROGRAM)
344349
$(EMUCMD) $<
345350
$(POSTEMUCMD)
346351

347-
dist: $(PROGRAM)
348-
cp dist.apple2/bootable.po dist.apple2/dist.po
349-
./dist.apple2/add-file.sh dist.apple2/dist.po config config.system
352+
$(DISK): $(PROGRAM) | $(R2R_DIR)
353+
cp dist.apple2/bootable.po $@
354+
./dist.apple2/add-file.sh $@ config config.system
355+
356+
dist: $(DISK)
350357
@( \
351-
echo "Attempting to copy autorun.po to firmware folder outside of project" ; \
358+
echo "Attempting to copy $(DISK) to firmware folder outside of project" ; \
352359
if [ -d ../fujinet-firmware/ ] ; then \
353360
echo "Copying into ../fujinet-firmware" ; \
354-
cp dist.apple2/dist.po ../fujinet-firmware/data/webui/device_specific/BUILD_APPLE/autorun.po ; \
361+
cp dist.apple2/dist.po ../fujinet-firmware/data/webui/device_specific/BUILD_APPLE/$(DISK) ; \
355362
elif [ -d ../fujinet-platformio/ ] ; then \
356363
echo "Copying into ../fujinet-platformio (NOTE: please consider renaming to updated fujinet-firmware name)" ; \
357-
cp dist.apple2/dist.po ../fujinet-platformio/data/webui/device_specific/BUILD_APPLE/autorun.po ; \
364+
cp dist.apple2/dist.po ../fujinet-platformio/data/webui/device_specific/BUILD_APPLE/$(DISK) ; \
358365
else \
359-
echo "ERROR: Could not find fujinet firmware folder to copy autorun.po to." ; \
366+
echo "ERROR: Could not find fujinet firmware folder to copy $(DISK) to." ; \
360367
echo "Tried ../fujinet-firmware, and ../fujinet-platformio" ; \
361368
exit 1 ; \
362369
fi ; \
363370
)
364371

372+
# Create the "Ready 2 Run" executable/disk
373+
r2r: get_fujinet_lib $(DISK)
374+
365375
gendebug: $(PROGRAM)
366376
@echo "Generating debug.scr script for AppleWin"
367377
@echo 'echo "Loading symbols"' > debug.scr
@@ -375,7 +385,7 @@ clean:
375385
$(call RMFILES,$(REMOVES))
376386
$(call RMFILES,$(PROGRAM))
377387
$(call RMFILES,*.map)
378-
rm -rf dist/
388+
rm -rf dist/ $(R2R_DIR)
379389

380390
else # $(words $(TARGETLIST)),1
381391

Makefile.atari

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ FUJINET_LIB_VERSION_DIR = $(FUJINET_LIB)/$(FUJINET_LIB_VERSION)-$(TARGETS)
1818
# Name of the final, single-file executable.
1919
# Default: name of the current dir with target name appended
2020
PROGRAM := config
21+
R2R_DIR := r2r/$(TARGETS)
22+
R2R_BIN := $(R2R_DIR)/autorun.atr
2123

2224
# Path(s) to additional libraries required for linking the program
2325
# Use only if you don't want to place copies of the libraries in SRCDIR
@@ -284,7 +286,7 @@ ASFLAGS += --asm-include-dir src/$(TARGETLIST)/asminc --asm-include-dir $(FUJINE
284286
CFLAGS += --include-dir $(FUJINET_LIB_VERSION_DIR) -DUSING_FUJINET_LIB
285287

286288
.SUFFIXES:
287-
.PHONY: all test clean get_fujinet_lib zap
289+
.PHONY: all test clean get_fujinet_lib zap r2r
288290

289291
all: get_fujinet_lib $(PROGRAM)
290292

@@ -344,6 +346,9 @@ get_fujinet_lib:
344346
$(TARGETOBJDIR):
345347
$(call MKDIR,$@)
346348

349+
$(R2R_DIR):
350+
$(call MKDIR,$@)
351+
347352
vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
348353

349354
$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR)
@@ -357,33 +362,38 @@ $(TARGETOBJDIR)/%.o: %.s | $(TARGETOBJDIR)
357362
$(PROGRAM): $(CONFIG) $(OBJECTS) $(LIBS)
358363
$(CC) -t $(CC65TARGET) $(LDFLAGS) -o $@ $(patsubst %.cfg,-C %.cfg,$^)
359364

365+
# Create the "Ready 2 Run" executable/disk
366+
r2r: get_fujinet_lib $(R2R_BIN)
367+
360368
test: $(PROGRAM)
361369
$(PREEMUCMD)
362370
$(EMUCMD) $<
363371
$(POSTEMUCMD)
364372

365373
test-atr: $(PROGRAM) dist
366374
$(PREEMUCMD) \
367-
$(EMUCMD) //disk autorun.atr \
375+
$(EMUCMD) //disk $(R2R_BIN) \
368376
$(POSTEMUCMD)
369377

370-
dist: $(PROGRAM)
378+
$(R2R_BIN): $(PROGRAM) | $(R2R_DIR)
371379
mkdir -p dist
372380
cp ../fujinet-tools/atari/dist/*.COM dist/ || true
373381
cp ../fujinet-tools/atari/dist/*.com dist/ || true
374382
cp $(PROGRAM) dist/
375-
dir2atr -m -S -B picoboot.bin autorun.atr dist/
383+
dir2atr -m -S -B picoboot.bin $@ dist/
384+
385+
dist: $(R2R_BIN)
376386

377387
dist-z: $(PROGRAM)
378388
@if [ -d "../fujinet-config-loader" ] ; then \
379-
echo "Found fujinet-config-loader, creating compressed autorun.atr"; \
389+
echo "Found fujinet-config-loader, creating compressed $(R2R_BIN)"; \
380390
$(MAKE) -C ../fujinet-config-loader clean dist > /dev/null 2>&1 ; \
381391
if [ $$? -ne 0 ] ; then \
382392
echo "ERROR running compressor"; \
383393
exit 1; \
384394
fi; \
385-
cp ../fujinet-config-loader/autorun-zx0.atr ./autorun.atr; \
386-
echo "Compressed file saved as autorun.atr"; \
395+
cp ../fujinet-config-loader/autorun-zx0.atr ./$(R2R_BIN); \
396+
echo "Compressed file saved as $(R2R_BIN)"; \
387397
else \
388398
echo "ERROR: Could not find fujinet-config-loader in sibling directory to current."; \
389399
exit 1; \

Makefile.c64

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ FUJINET_LIB_VERSION_DIR = $(FUJINET_LIB)/$(FUJINET_LIB_VERSION)-$(TARGETS)
1818
# Name of the final, single-file executable.
1919
# Default: name of the current dir with target name appended
2020
PROGRAM := config
21+
R2R_DIR := r2r/$(TARGETS)
22+
R2R_BIN := $(R2R_DIR)/$(PROGRAM).prg
2123

2224
# Path(s) to additional libraries required for linking the program
2325
# Use only if you don't want to place copies of the libraries in SRCDIR
@@ -260,7 +262,7 @@ ASFLAGS += --asm-include-dir src/$(TARGETLIST)/asminc --asm-include-dir $(FUJINE
260262
CFLAGS += --include-dir $(FUJINET_LIB_VERSION_DIR) -DUSING_FUJINET_LIB
261263

262264
.SUFFIXES:
263-
.PHONY: all test clean get_fujinet_lib zap
265+
.PHONY: all test clean get_fujinet_lib zap r2r
264266

265267
all: get_fujinet_lib $(PROGRAM)
266268

@@ -320,6 +322,9 @@ get_fujinet_lib:
320322
$(TARGETOBJDIR):
321323
$(call MKDIR,$@)
322324

325+
$(R2R_DIR):
326+
$(call MKDIR,$@)
327+
323328
vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
324329

325330
$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR)
@@ -330,9 +335,12 @@ vpath %.s $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
330335
$(TARGETOBJDIR)/%.o: %.s | $(TARGETOBJDIR)
331336
$(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $<
332337

333-
$(PROGRAM): $(CONFIG) $(OBJECTS) $(LIBS)
338+
$(R2R_BIN): $(CONFIG) $(OBJECTS) $(LIBS) | $(R2R_DIR)
334339
$(CC) -t $(CC65TARGET) $(LDFLAGS) -o $@ $(patsubst %.cfg,-C %.cfg,$^)
335340

341+
# Create the "Ready 2 Run" executable/disk
342+
r2r: get_fujinet_lib $(R2R_BIN)
343+
336344
test: $(PROGRAM)
337345
$(PREEMUCMD)
338346
$(EMUCMD) $<

Makefile.coco

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,32 @@ AS=lwasm
55
CP=cp
66
ECHO=echo
77
FIRMWARE_DIR="../fujinet-firmware"
8-
9-
config.bin: check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
10-
$(CC) -o config.bin check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
11-
$(RM) autorun.dsk
12-
decb dskini autorun.dsk
13-
decb copy -t -0 dist.coco/autoexec.bas autorun.dsk,AUTOEXEC.BAS
14-
writecocofile autorun.dsk config.bin
15-
$(CP) autorun.dsk $(FIRMWARE_DIR)/data/webui/device_specific/BUILD_COCO/
16-
# $(CP) autorun.dsk ~/tnfs/
8+
TARGET_EXEC=config.bin
9+
DISK=autorun.dsk
10+
R2R_DIR=r2r/coco
11+
R2R_BIN=$(R2R_DIR)/$(DISK)
12+
13+
$(TARGET_EXEC): check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
14+
$(CC) -o $@ check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
15+
16+
$(R2R_BIN): $(TARGET_EXEC) | $(R2R_DIR)
17+
$(RM) $@
18+
decb dskini $@
19+
decb copy -t -0 dist.coco/autoexec.bas $@,AUTOEXEC.BAS
20+
writecocofile $@ $<
21+
22+
dist: $(R2R_BIN)
23+
$(CP) $< $(FIRMWARE_DIR)/data/webui/device_specific/BUILD_COCO/
1724
$(ECHO) Now, Do a Upload Filesystem task.
1825

26+
.PHONY: r2r
27+
28+
# Create the "Ready 2 Run" executable/disk
29+
r2r: $(R2R_BIN)
30+
31+
$(R2R_DIR):
32+
mkdir -p $@
33+
1934
pause.o: src/coco/pause.c
2035
$(CC) -c src/coco/pause.c
2136

@@ -73,5 +88,5 @@ screen.o: src/coco/screen.c
7388
clean:
7489
$(RM) *.o
7590
$(RM) coco/*.o
76-
$(RM) config.bin
77-
$(RM) autorun.dsk
91+
$(RM) $(TARGET_EXEC)
92+
$(RM) $(DISK)

Makefile.msdos

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
TARGET = config.com
2+
R2R_DIR = r2r/msdos
3+
R2R_BIN = $(R2R_DIR)/$(TARGET)
4+
25
CC = wcc
36
CFLAGS = -q -0 -bt=dos -ms -osh $(CPPFLAGS) -i=src -i=src/msdos
47

@@ -10,9 +13,15 @@ SOURCE = src/check_wifi.c src/connect_wifi.c src/destination_host_slot.c src/hos
1013

1114
all: $(TARGET)
1215

13-
$(TARGET): $(OBJS)
16+
# Create the "Ready 2 Run" executable/disk
17+
r2r: $(R2R_BIN)
18+
19+
$(R2R_BIN): $(OBJS) | $(R2R_DIR)
1420
$(LD) $(LDFLAGS) NAME $@
1521

22+
$(R2R_DIR):
23+
mkdir -p $@
24+
1625
src/check_wifi.obj: src/check_wifi.c
1726
$(CC) $(CFLAGS) src/check_wifi.c
1827

0 commit comments

Comments
 (0)