-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
152 lines (121 loc) · 4.53 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
RYFS := $(CURDIR)/meta/ryfs/ryfs.py
FOX32ASM := ../fox32asm/target/release/fox32asm
OKAMERON := $(CURDIR)/meta/okameron/okameron.lua
GFX2INC := ../tools/gfx2inc/target/release/gfx2inc
IMAGE_SIZE := 16777216
ROM_IMAGE_SIZE := 196608
BOOTLOADER := bootloader/bootloader.bin
all: base_image/streamio.lbr fox32os.img romdisk.img
base_image:
mkdir -p base_image
base_image/kernel.fxf: kernel/main.asm $(wildcard kernel/*.asm kernel/*/*.asm)
$(FOX32ASM) $< $@
base_image/sh.fxf: applications/sh/main.asm $(wildcard applications/sh/*.asm applications/sh/*/*.asm)
$(FOX32ASM) $< $@
base_image/barclock.fxf: applications/barclock/main.asm
$(FOX32ASM) $< $@
base_image/terminal.fxf: applications/terminal/main.asm $(wildcard applications/terminal/*.asm)
$(FOX32ASM) $< $@
base_image/fetcher.fxf: applications/fetcher/Fetcher.okm $(wildcard applications/fetcher/*.okm)
lua $(OKAMERON) -arch=fox32 -startup=applications/fetcher/start.asm $< \
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
base_image/pride.fxf: applications/pride/main.asm
$(FOX32ASM) $< $@
base_image/loadfont.fxf: applications/loadfont/main.asm
$(FOX32ASM) $< $@
base_image/tasks.fxf: applications/tasks/main.asm
$(FOX32ASM) $< $@
base_image/serial.fxf: applications/serial/main.asm $(wildcard applications/terminal/*.asm)
$(FOX32ASM) $< $@
base_image/foxpaint.fxf: applications/foxpaint/main.asm
$(FOX32ASM) $< $@
base_image/ted.fxf: applications/ted/TEd.okm $(wildcard applications/ted/*.okm)
lua $(OKAMERON) -arch=fox32 -startup=applications/ted/start.asm $< \
applications/ted/OS.okm \
> applications/ted/ted.asm
$(FOX32ASM) applications/ted/ted.asm $@
rm applications/ted/ted.asm
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
base_image/bg.fxf: applications/bg/main.asm
$(FOX32ASM) $< $@
base_image/bg.bmp: applications/bg/bg.bmp
cp $< $@
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)
$(FOX32ASM) $< $@
base_image/startup.bat: base_image/startup.bat.default
cp $< $@
ICONS16 := \
applications/icons/mnu.inc
ICONS32 := \
applications/icons/dsk.inc \
applications/icons/fxf.inc \
applications/icons/msc.inc
applications/icons/%.inc: applications/icons/%.16.png
$(GFX2INC) 16 16 $< $@
applications/icons/%.inc: applications/icons/%.32.png
$(GFX2INC) 32 32 $< $@
base_image/icons.res: applications/icons/icons.res.asm $(ICONS16) $(ICONS32)
$(FOX32ASM) $< $@
FILES = \
base_image/startup.bat \
base_image/icons.res \
base_image/kernel.fxf \
base_image/sh.fxf \
base_image/barclock.fxf \
base_image/terminal.fxf \
base_image/fetcher.fxf \
base_image/serial.fxf \
base_image/pride.fxf \
base_image/foxpaint.fxf \
base_image/okmpaint.fxf \
base_image/bg.fxf \
base_image/bg.bmp \
base_image/launcher.fxf \
base_image/ted.fxf \
base_image/loadfont.fxf \
base_image/tasks.fxf
ROM_FILES = \
base_image/startup.bat \
base_image/icons.res \
base_image/kernel.fxf \
base_image/sh.fxf \
base_image/barclock.fxf \
base_image/terminal.fxf \
base_image/fetcher.fxf \
base_image/serial.fxf \
base_image/pride.fxf \
base_image/bg.fxf \
base_image/launcher.fxf \
base_image/ted.fxf \
base_image/loadfont.fxf \
base_image/tasks.fxf
base_image/%.lbr: $(wildcard libraries/*/*.asm)
cd libraries && $(MAKE)
fox32os.img: $(BOOTLOADER) $(FILES) $(wildcard libraries/*/*.asm)
$(RYFS) -s $(IMAGE_SIZE) -l fox32os -b $(BOOTLOADER) create [email protected]
for file in base_image/*.lbr; do $(RYFS) add [email protected] $$file; done
for file in $(FILES); do $(RYFS) add [email protected] $$file; done
mv [email protected] $@
romdisk.img: $(BOOTLOADER) $(ROM_FILES) $(wildcard libraries/*/*.asm)
$(RYFS) -s $(ROM_IMAGE_SIZE) -l romdisk -b $(BOOTLOADER) create [email protected]
for file in base_image/*.lbr; do $(RYFS) add [email protected] $$file; done
for file in $(ROM_FILES); do $(RYFS) add [email protected] $$file; done
mv [email protected] $@
clean:
cd libraries && $(MAKE) clean
rm -f $(FILES)
.PHONY: clean