Merge pull request #5 from neuschaefer/main

Makefile and GitHub CI
This commit is contained in:
Ry 2023-01-20 18:04:51 -08:00 committed by GitHub
commit b84cbb1863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 111 additions and 42 deletions

56
.github/workflows/fox32os-unstable.yml vendored Normal file
View File

@ -0,0 +1,56 @@
on:
workflow_dispatch:
push:
branches:
- main
name: fox32os Unstable
jobs:
fox32os-unstable-linux:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download latest fox32asm artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: fox32-arch/fox32asm
workflow: fox32asm-unstable-linux.yml
workflow_conclusion: success
- name: Download latest fox32rom artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: fox32-arch/fox32rom
workflow: fox32rom-unstable.yml
workflow_conclusion: success
- name: Download latest tools artifact
uses: dawidd6/action-download-artifact@v2
with:
repo: fox32-arch/tools
workflow: tools-unstable-linux.yml
workflow_conclusion: success
- name: Build
run: |
mkdir ../fox32rom
cp fox32rom.def/fox32rom.def ../fox32rom/
chmod +x fox32asm/fox32asm gfx2inc/gfx2inc
make FOX32ASM=fox32asm/fox32asm GFX2INC=gfx2inc/gfx2inc
- name: Upload fox32os.img
uses: actions/upload-artifact@v3
with:
name: fox32os.img
path: fox32os.img
- name: Upload fox32os.def
uses: actions/upload-artifact@v3
with:
name: fox32os.def
path: fox32os.def

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
**/bg.inc
**/bg.raw
**/fox32os.img
**/fox32os.img.tmp

48
Makefile Normal file
View File

@ -0,0 +1,48 @@
RYFS := $(CURDIR)/meta/ryfs/ryfs.py
FOX32ASM := ../fox32asm/target/release/fox32asm
GFX2INC := ../tools/gfx2inc/target/release/gfx2inc
IMAGE_SIZE := 16777216
BOOTLOADER := bootloader/bootloader.bin
all: fox32os.img
base_image:
mkdir -p base_image
base_image/kernel.fxf: kernel/main.asm
$(FOX32ASM) $< $@
base_image/barclock.fxf: applications/barclock/main.asm
$(FOX32ASM) $< $@
base_image/terminal.fxf: applications/terminal/main.asm
$(FOX32ASM) $< $@
base_image/foxpaint.fxf: applications/foxpaint/main.asm
$(FOX32ASM) $< $@
base_image/bg.fxf: applications/bg/main.asm
$(FOX32ASM) $< $@
base_image/bg.raw: applications/bg/bg.inc
$(FOX32ASM) $< $@
applications/bg/bg.inc: applications/bg/bg.png
$(GFX2INC) 640 480 $< $@
bootloader/bootloader.bin: bootloader/main.asm
$(FOX32ASM) $< $@
FILES = \
base_image/kernel.fxf \
base_image/barclock.fxf \
base_image/terminal.fxf \
base_image/foxpaint.fxf \
base_image/bg.fxf \
base_image/bg.raw
fox32os.img: $(BOOTLOADER) $(FILES)
$(RYFS) -s $(IMAGE_SIZE) -l fox32os -b $(BOOTLOADER) create fox32os.img.tmp
cd base_image; for file in *; do $(RYFS) add ../fox32os.img.tmp $$file; done
cp fox32os.img.tmp fox32os.img

View File

@ -8,5 +8,11 @@
Stable releases are available on the [Releases page](https://github.com/fox32-arch/fox32os/releases).
## How to build
- Download [tools](https://github.com/fox32-arch/tools) and [fox32asm](https://github.com/fox32-arch/fox32asm).
Either use the pre-built binaries or build them.
- Run `make`
## License
This project is licensed under the [MIT license](LICENSE).

View File

@ -1,42 +0,0 @@
#!/usr/bin/env bash
set -e
mkdir -p base_image
# if fox32os.img doesn't exist, then create it
if [ ! -f fox32os.img ]; then
echo "fox32os.img not found, creating it"
echo "assembling bootloader"
../fox32asm/target/release/fox32asm bootloader/main.asm bootloader/bootloader.bin
meta/ryfs/ryfs.py -s 16777216 -l fox32os -b bootloader/bootloader.bin create fox32os.img
rm bootloader/bootloader.bin
fi
echo "assembling kernel"
../fox32asm/target/release/fox32asm kernel/main.asm base_image/kernel.fxf
echo "assembling barclock"
../fox32asm/target/release/fox32asm applications/barclock/main.asm base_image/barclock.fxf
echo "assembling terminal"
../fox32asm/target/release/fox32asm applications/terminal/main.asm base_image/terminal.fxf
echo "assembling foxpaint"
../fox32asm/target/release/fox32asm applications/foxpaint/main.asm base_image/foxpaint.fxf
echo "assembling bg"
../fox32asm/target/release/fox32asm applications/bg/main.asm base_image/bg.fxf
echo "creating bg.raw"
../tools/gfx2inc/target/release/gfx2inc 640 480 applications/bg/bg.png applications/bg/bg.inc
../fox32asm/target/release/fox32asm applications/bg/bg.inc base_image/bg.raw
echo "adding files to fox32os.img"
cd base_image
for file in ./*; do
../meta/ryfs/ryfs.py add ../fox32os.img $file
done