forked from fox32-arch/kitsune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (49 loc) · 1.69 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
OKAMERON := $(CURDIR)/meta/okameron/okameron.lua
FOX32ASM := ../fox32asm/target/release/fox32asm
RYFS := $(CURDIR)/meta/ryfs/ryfs.py
GFX2INC := ../tools/gfx2inc/target/release/gfx2inc
FOX32ROMDEF := ../fox32rom/fox32rom.def.okm
IMAGE_SIZE := 16777216
ROM_IMAGE_SIZE := 65536
BOOTLOADER := bootloader/bootloader.bin
KERNEL := base_image/kernel.fxf
all: kitsune.img romdisk.img
KENREL_INPUT_FILES = \
kernel/Main.okm \
kernel/Allocator.okm \
kernel/Debug.okm \
kernel/FXF.okm \
kernel/Process.okm \
kernel/RYFS.okm \
kernel/String.okm \
kernel/Syscall.okm \
kernel/VFS.okm
bootloader/bootloader.bin: bootloader/main.asm $(wildcard bootloader/*.asm)
$(FOX32ASM) $< $@
base_image/kernel.fxf: $(KENREL_INPUT_FILES) $(wildcard kernel/*.okm kernel/*/*.okm kernel/*.asm kernel/*/*.asm)
lua $(OKAMERON) -arch=fox32 -startup=kernel/start.asm $(KENREL_INPUT_FILES) $(FOX32ROMDEF) > kernel/kernel.asm
$(FOX32ASM) kernel/kernel.asm $@
rm kernel/kernel.asm
APPLICATIONS = \
base_image/init.fxf \
base_image/fbterm.fxf
APPLICATIONS_ROM = \
base_image/init.fxf \
base_image/fbterm.fxf
$(APPLICATIONS):
cd applications && $(MAKE)
kitsune.img: $(BOOTLOADER) $(KERNEL) $(APPLICATIONS)
$(RYFS) -s $(IMAGE_SIZE) -l kitsune -b $(BOOTLOADER) create [email protected]
$(RYFS) add [email protected] $(KERNEL)
for file in $(APPLICATIONS); do $(RYFS) add [email protected] $$file; done
mv [email protected] $@
romdisk.img: $(BOOTLOADER) $(KERNEL) $(APPLICATIONS_ROM)
$(RYFS) -s $(ROM_IMAGE_SIZE) -l romdisk -b $(BOOTLOADER) create [email protected]
$(RYFS) add [email protected] $(KERNEL)
for file in $(APPLICATIONS_ROM); do $(RYFS) add [email protected] $$file; done
mv [email protected] $@
clean:
rm -f $(KERNEL)
rm -f $(APPLICATIONS)
cd applications && $(MAKE) clean
.PHONY: clean $(APPLICATIONS)