fox32os/Makefile

119 lines
3.5 KiB
Makefile
Raw Normal View History

2023-01-20 14:39:58 +01:00
RYFS := $(CURDIR)/meta/ryfs/ryfs.py
FOX32ASM := ../fox32asm/target/release/fox32asm
2023-06-26 01:46:42 +02:00
OKAMERON := $(CURDIR)/meta/okameron/okameron.lua
2023-01-20 14:39:58 +01:00
GFX2INC := ../tools/gfx2inc/target/release/gfx2inc
IMAGE_SIZE := 16777216
2023-03-05 08:35:04 +01:00
ROM_IMAGE_SIZE := 65536
2023-01-20 14:39:58 +01:00
BOOTLOADER := bootloader/bootloader.bin
2023-03-05 08:35:04 +01:00
all: fox32os.img romdisk.img
2023-01-20 14:39:58 +01:00
base_image:
mkdir -p base_image
base_image/kernel.fxf: kernel/main.asm $(wildcard kernel/*.asm kernel/*/*.asm)
2023-01-20 14:39:58 +01:00
$(FOX32ASM) $< $@
base_image/sh.fxf: applications/sh/main.asm $(wildcard applications/sh/*.asm applications/sh/*/*.asm)
$(FOX32ASM) $< $@
2023-01-20 14:39:58 +01:00
base_image/barclock.fxf: applications/barclock/main.asm
$(FOX32ASM) $< $@
base_image/terminal.fxf: applications/terminal/main.asm $(wildcard applications/terminal/*.asm)
2023-01-20 14:39:58 +01:00
$(FOX32ASM) $< $@
base_image/fetcher.fxf: applications/fetcher/Fetcher.okm $(wildcard applications/fetcher/*.okm)
lua $(OKAMERON) -arch=fox32 -startup=applications/fetcher/start.asm $< \
2023-07-16 06:56:09 +02:00
applications/fetcher/About.okm \
applications/fetcher/Browser.okm \
applications/fetcher/BrowserOpen.okm \
applications/fetcher/Desktop.okm \
applications/fetcher/OS.okm \
> applications/fetcher/fetcher.asm
$(FOX32ASM) applications/fetcher/fetcher.asm $@
rm applications/fetcher/fetcher.asm
2023-02-02 03:18:08 +01:00
base_image/serial.fxf: applications/serial/main.asm $(wildcard applications/terminal/*.asm)
$(FOX32ASM) $< $@
2023-01-20 14:39:58 +01:00
base_image/foxpaint.fxf: applications/foxpaint/main.asm
$(FOX32ASM) $< $@
2023-06-26 01:46:42 +02:00
base_image/okmpaint.fxf: applications/okmpaint/OkmPaint.okm $(wildcard applications/okmpaint/*.okm)
lua $(OKAMERON) -arch=fox32 -startup=applications/okmpaint/start.asm $< > applications/okmpaint/okmpaint.asm
$(FOX32ASM) applications/okmpaint/okmpaint.asm $@
rm applications/okmpaint/okmpaint.asm
2023-01-20 14:39:58 +01:00
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 $< $@
2023-01-25 02:08:27 +01:00
base_image/launcher.fxf: applications/launcher/main.asm $(wildcard applications/launcher/*.asm) applications/launcher/icons.inc
$(FOX32ASM) $< $@
applications/launcher/icons.inc: applications/launcher/icons.png
$(GFX2INC) 16 16 $< $@
bootloader/bootloader.bin: bootloader/main.asm $(wildcard bootloader/*.asm)
2023-01-20 14:39:58 +01:00
$(FOX32ASM) $< $@
base_image/startup.bat: base_image/startup.bat.default
cp $< $@
ICONS := \
applications/icons/dsk.inc \
applications/icons/fxf.inc \
applications/icons/msc.inc
applications/icons/%.inc: applications/icons/%.png
$(GFX2INC) 32 32 $< $@
base_image/icons.res: applications/icons/icons.res.asm $(ICONS)
$(FOX32ASM) $< $@
2023-01-20 14:39:58 +01:00
FILES = \
base_image/startup.bat \
base_image/icons.res \
2023-01-20 14:39:58 +01:00
base_image/kernel.fxf \
base_image/sh.fxf \
2023-01-20 14:39:58 +01:00
base_image/barclock.fxf \
base_image/terminal.fxf \
base_image/fetcher.fxf \
2023-02-02 03:18:08 +01:00
base_image/serial.fxf \
2023-01-20 14:39:58 +01:00
base_image/foxpaint.fxf \
2023-06-26 01:46:42 +02:00
base_image/okmpaint.fxf \
2023-01-20 14:39:58 +01:00
base_image/bg.fxf \
2023-01-25 02:08:27 +01:00
base_image/bg.raw \
base_image/launcher.fxf
2023-01-20 14:39:58 +01:00
2023-03-05 08:35:04 +01:00
ROM_FILES = \
base_image/startup.bat \
base_image/icons.res \
2023-03-05 08:35:04 +01:00
base_image/kernel.fxf \
base_image/sh.fxf \
base_image/barclock.fxf \
base_image/terminal.fxf \
base_image/fetcher.fxf \
2023-03-05 08:35:04 +01:00
base_image/serial.fxf \
base_image/bg.fxf \
base_image/launcher.fxf
2023-01-20 14:39:58 +01:00
fox32os.img: $(BOOTLOADER) $(FILES)
2023-02-01 20:32:17 +01:00
$(RYFS) -s $(IMAGE_SIZE) -l fox32os -b $(BOOTLOADER) create $@.tmp
for file in $(FILES); do $(RYFS) add $@.tmp $$file; done
mv $@.tmp $@
2023-03-05 08:35:04 +01:00
romdisk.img: $(BOOTLOADER) $(ROM_FILES)
$(RYFS) -s $(ROM_IMAGE_SIZE) -l romdisk -b $(BOOTLOADER) create $@.tmp
for file in $(ROM_FILES); do $(RYFS) add $@.tmp $$file; done
mv $@.tmp $@
2023-03-16 01:02:55 +01:00
clean:
rm -f $(FILES)