forked from yourtion/30dayMakeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
220 lines (165 loc) · 5.74 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
OBJS_BOOTPACK = bootpack.obj naskfunc.obj hankaku.obj graphic.obj dsctbl.obj \
int.obj fifo.obj keyboard.obj mouse.obj memory.obj sheet.obj timer.obj \
mtask.obj window.obj console.obj file.obj
TOOLPATH = ../z_tools/
INCPATH = ../z_tools/haribote/
MAKE = $(TOOLPATH)make.exe -r
NASK = $(TOOLPATH)nask.exe
CC1 = $(TOOLPATH)cc1.exe -I$(INCPATH) -Os -Wall -quiet
GAS2NASK = $(TOOLPATH)gas2nask.exe -a
OBJ2BIM = $(TOOLPATH)obj2bim.exe
MAKEFONT = $(TOOLPATH)makefont.exe
BIN2OBJ = $(TOOLPATH)bin2obj.exe
BIM2HRB = $(TOOLPATH)bim2hrb.exe
RULEFILE = $(TOOLPATH)haribote/haribote.rul
EDIMG = $(TOOLPATH)edimg.exe
IMGTOL = $(TOOLPATH)imgtol.com
COPY = copy
DEL = del
# 默认动作
default :
$(MAKE) img
# 镜像文件生成
ipl10.bin : ipl10.nas Makefile
$(NASK) ipl10.nas ipl10.bin ipl10.lst
asmhead.bin : asmhead.nas Makefile
$(NASK) asmhead.nas asmhead.bin asmhead.lst
hankaku.bin : hankaku.txt Makefile
$(MAKEFONT) hankaku.txt hankaku.bin
hankaku.obj : hankaku.bin Makefile
$(BIN2OBJ) hankaku.bin hankaku.obj _hankaku
bootpack.bim : $(OBJS_BOOTPACK) Makefile
$(OBJ2BIM) @$(RULEFILE) out:bootpack.bim stack:3136k map:bootpack.map \
$(OBJS_BOOTPACK)
# 3MB+64KB=3136KB
bootpack.hrb : bootpack.bim Makefile
$(BIM2HRB) bootpack.bim bootpack.hrb 0
haribote.sys : asmhead.bin bootpack.hrb Makefile
copy /B asmhead.bin+bootpack.hrb haribote.sys
hello.hrb : hello.nas Makefile
$(NASK) hello.nas hello.hrb hello.lst
hello2.hrb : hello2.nas Makefile
$(NASK) hello2.nas hello2.hrb hello2.lst
a.bim : a.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:a.bim map:a.map a.obj a_nask.obj
a.hrb : a.bim Makefile
$(BIM2HRB) a.bim a.hrb 0
hello3.bim : hello3.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:hello3.bim map:hello3.map hello3.obj a_nask.obj
hello3.hrb : hello3.bim Makefile
$(BIM2HRB) hello3.bim hello3.hrb 0
hello4.bim : hello4.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:hello4.bim stack:1k map:hello4.map \
hello4.obj a_nask.obj
hello4.hrb : hello4.bim Makefile
$(BIM2HRB) hello4.bim hello4.hrb 0
hello5.bim : hello5.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:hello5.bim stack:1k map:hello5.map hello5.obj
hello5.hrb : hello5.bim Makefile
$(BIM2HRB) hello5.bim hello5.hrb 0
bug2.bim : bug2.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:bug2.bim map:bug2.map bug2.obj
bug2.hrb : bug2.bim Makefile
$(BIM2HRB) bug2.bim bug2.hrb 0
bug3.bim : bug3.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:bug3.bim map:bug3.map bug3.obj a_nask.obj
bug3.hrb : bug3.bim Makefile
$(BIM2HRB) bug3.bim bug3.hrb 0
winhelo.bim : winhelo.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:winhelo.bim stack:1k map:winhelo.map \
winhelo.obj a_nask.obj
winhelo.hrb : winhelo.bim Makefile
$(BIM2HRB) winhelo.bim winhelo.hrb 0
winhelo2.bim : winhelo2.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:winhelo2.bim stack:1k map:winhelo2.map \
winhelo2.obj a_nask.obj
winhelo2.hrb : winhelo2.bim Makefile
$(BIM2HRB) winhelo2.bim winhelo2.hrb 0
winhelo3.bim : winhelo3.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:winhelo3.bim stack:1k map:winhelo3.map \
winhelo3.obj a_nask.obj
winhelo3.hrb : winhelo3.bim Makefile
$(BIM2HRB) winhelo3.bim winhelo3.hrb 40k
star1.bim : star1.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:star1.bim stack:1k map:star1.map \
star1.obj a_nask.obj
star1.hrb : star1.bim Makefile
$(BIM2HRB) star1.bim star1.hrb 47k
stars.bim : stars.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:stars.bim stack:1k map:stars.map \
stars.obj a_nask.obj
stars.hrb : stars.bim Makefile
$(BIM2HRB) stars.bim stars.hrb 47k
stars2.bim : stars2.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:stars2.bim stack:1k map:stars2.map \
stars2.obj a_nask.obj
stars2.hrb : stars2.bim Makefile
$(BIM2HRB) stars2.bim stars2.hrb 47k
lines.bim : lines.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:lines.bim stack:1k map:lines.map \
lines.obj a_nask.obj
lines.hrb : lines.bim Makefile
$(BIM2HRB) lines.bim lines.hrb 48k
walk.bim : walk.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:walk.bim stack:1k map:walk.map \
walk.obj a_nask.obj
walk.hrb : walk.bim Makefile
$(BIM2HRB) walk.bim walk.hrb 48k
noodle.bim : noodle.obj a_nask.obj Makefile
$(OBJ2BIM) @$(RULEFILE) out:noodle.bim stack:1k map:noodle.map \
noodle.obj a_nask.obj
noodle.hrb : noodle.bim Makefile
$(BIM2HRB) noodle.bim noodle.hrb 40k
haribote.img : ipl10.bin haribote.sys Makefile \
hello.hrb hello2.hrb a.hrb hello3.hrb hello4.hrb hello5.hrb \
winhelo.hrb winhelo2.hrb winhelo3.hrb star1.hrb stars.hrb stars2.hrb \
lines.hrb walk.hrb noodle.hrb
$(EDIMG) imgin:../z_tools/fdimg0at.tek \
wbinimg src:ipl10.bin len:512 from:0 to:0 \
copy from:haribote.sys to:@: \
copy from:ipl10.nas to:@: \
copy from:make.bat to:@: \
copy from:hello.hrb to:@: \
copy from:hello2.hrb to:@: \
copy from:a.hrb to:@: \
copy from:hello3.hrb to:@: \
copy from:hello4.hrb to:@: \
copy from:hello5.hrb to:@: \
copy from:winhelo.hrb to:@: \
copy from:winhelo2.hrb to:@: \
copy from:winhelo3.hrb to:@: \
copy from:star1.hrb to:@: \
copy from:stars.hrb to:@: \
copy from:stars2.hrb to:@: \
copy from:lines.hrb to:@: \
copy from:walk.hrb to:@: \
copy from:noodle.hrb to:@: \
imgout:haribote.img
# 其他指令
%.gas : %.c bootpack.h Makefile
$(CC1) -o $*.gas $*.c
%.nas : %.gas Makefile
$(GAS2NASK) $*.gas $*.nas
%.obj : %.nas Makefile
$(NASK) $*.nas $*.obj $*.lst
# 运行程序
img :
$(MAKE) haribote.img
run :
$(MAKE) img
$(COPY) haribote.img ..\z_tools\qemu\fdimage0.bin
$(MAKE) -C ../z_tools/qemu
install :
$(MAKE) img
$(IMGTOL) w a: haribote.img
clean :
-$(DEL) *.bin
-$(DEL) *.lst
-$(DEL) *.obj
-$(DEL) bootpack.map
-$(DEL) bootpack.bim
-$(DEL) bootpack.hrb
-$(DEL) haribote.sys
src_only :
$(MAKE) clean
-$(DEL) haribote.img