1#
2# Makefile.dos for DosUAE
3#
4
5CC        = gcc
6CPP       = gcc -E
7CFLAGS    = -O3 -fomit-frame-pointer -Wall -Wtraditional -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -DGCCCONSTFUNC="__attribute__((const))" -DX86_ASSEMBLY -DUSE_UNDERSCORE -fno-strength-reduce -DINTEL_FLAG_OPT=1 -DREGPARAM="__attribute__((regparm(3)))" -DUSE_ZFILE -D__inline__=inline -DSTATFS_NO_ARGS=2 -DSTATBUF_BAVAIL=f_bfree -D__DOS__
8GFXOBJS   = tui.o machdep/video/conio-ui.o machdep/video/vbe.o machdep/video/video.o
9SNDOBJS   = machdep/sound/dma.o machdep/sound/sb.o machdep/sound/gus.o
10MISCOBJS  = machdep/misc/misc.o machdep/misc/handlers.o
11ASMOBJS   = X86.o
12CPUOBJS   = cpu_f0.o cpu_f1.o cpu_f2.o cpu_f3.o cpu_f4.o cpu_f5.o cpu_f6.o cpu_f7.o cpu_f8.o cpu_f9.o cpu_fA.o cpu_fB.o cpu_fC.o cpu_fD.o cpu_fE.o cpu_fF.o
13DEBUGOBJS = debug.o
14MATHLIB   = -lm
15
16.SUFFIXES: .o .c .h .m .i
17
18INCLUDES=-I../src/include/ -I../src/ -I../src/machdep/
19
20OBJS = main.o newcpu.o memory.o custom.o cia.o serial.o disk.o blitter.o os.o \
21       autoconf.o ersatz.o filesys.o hardfile.o keybuf.o expansion.o zfile.o \
22       fpp.o readcpu.o cpudefs.o gfxutil.o gfxlib.o blitfunc.o blittable.o \
23       compiler.o uaelib.o execlib.o timerdev.o machdep/support.o cpustbl.o \
24       $(ASMOBJS) $(CPUOBJS) $(GFXOBJS) $(DEBUGOBJS) $(SNDOBJS) $(MISCOBJS) \
25
26all: uae.exe readdisk.exe
27
28readdisk.exe: readdisk.o
29	$(CC) readdisk.o -o readdisk
30	strip readdisk
31	coff2exe readdisk
32
33uae.exe: $(OBJS)
34	$(CC) $(OBJS) -o uae $(MATHLIB)
35	strip uae
36	coff2exe uae
37
38clean:
39	del *.o
40	del machdep\*.o
41	del machdep\video\*.o
42	del machdep\sound\*.o
43	del machdep\misc\*.o
44	del uae
45	del uae.exe
46	del readdisk
47	del readdisk.exe
48	del gencpu.exe
49	del genblitter.exe
50	del build68k.exe
51	del cpudefs.c
52	del cpuopti.exe
53	del cpu?.c
54	del blit.h
55	del cputbl.h
56	del cpustbl.c
57	del cpu_f?.s
58	del blitfunc.c
59	del blitfunc.h
60	del blittable.c
61	del config.h
62
63halfclean:
64	del *.o
65	del machdep\*.o
66	del machdep\video\*.o
67	del machdep\sound\*.o
68	del machdep\misc\*.o
69
70blit.h: genblitter.exe
71	genblitter i >blit.h
72blitfunc.c: genblitter.exe blitfunc.h
73	genblitter f >blitfunc.c
74blitfunc.h: genblitter.exe
75	genblitter h >blitfunc.h
76blittable.c: genblitter.exe blitfunc.h
77	genblitter t >blittable.c
78
79genblitter.exe: genblitter.o blitops.o
80	$(CC) -o genblitter.exe genblitter.o blitops.o
81build68k.exe: build68k.o
82	$(CC) -o build68k.exe build68k.o
83cpuopti.exe: cpuopti.o
84	$(CC) -o cpuopti.exe cpuopti.o
85gencpu.exe: gencpu.o readcpu.o cpudefs.o
86	$(CC) -o gencpu.exe gencpu.o readcpu.o cpudefs.o
87
88custom.o: blit.h
89
90cpudefs.c: build68k.exe table68k
91	build68k.exe >cpudefs.c
92cpustbl.c: gencpu.exe
93	gencpu s >cpustbl.c
94cputbl.c: gencpu.exe
95	gencpu t >cputbl.c
96cputbl.h: gencpu.exe
97	gencpu h >cputbl.h
98
99cpu0.c: gencpu.exe
100	gencpu f 0 >cpu0.c
101cpu1.c: gencpu.exe
102	gencpu f 1 >cpu1.c
103cpu2.c: gencpu.exe
104	gencpu f 2 >cpu2.c
105cpu3.c: gencpu.exe
106	gencpu f 3 >cpu3.c
107cpu4.c: gencpu.exe
108	gencpu f 4 >cpu4.c
109cpu5.c: gencpu.exe
110	gencpu f 5 >cpu5.c
111cpu6.c: gencpu.exe
112	gencpu f 6 >cpu6.c
113cpu7.c: gencpu.exe
114	gencpu f 7 >cpu7.c
115cpu8.c: gencpu.exe
116	gencpu f 8 >cpu8.c
117cpu9.c: gencpu.exe
118	gencpu f 9 >cpu9.c
119cpuA.c: gencpu.exe
120	gencpu f 10 >cpuA.c
121cpuB.c: gencpu.exe
122	gencpu f 11 >cpuB.c
123cpuC.c: gencpu.exe
124	gencpu f 12 >cpuC.c
125cpuD.c: gencpu.exe
126	gencpu f 13 >cpuD.c
127cpuE.c: gencpu.exe
128	gencpu f 14 >cpuE.c
129cpuF.c: gencpu.exe
130	gencpu f 15 >cpuF.c
131
132cpu0.o: cpu0.c cputbl.h
133	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
134cpu1.o: cpu1.c cputbl.h
135	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
136cpu2.o: cpu2.c cputbl.h
137	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
138cpu3.o: cpu3.c cputbl.h
139	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
140cpu4.o: cpu4.c cputbl.h
141	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
142cpu5.o: cpu5.c cputbl.h
143	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
144cpu6.o: cpu6.c cputbl.h
145	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
146cpu7.o: cpu7.c cputbl.h
147	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
148cpu8.o: cpu8.c cputbl.h
149	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
150cpu9.o: cpu9.c cputbl.h
151	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
152cpuA.o: cpuA.c cputbl.h
153	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
154cpuB.o: cpuB.c cputbl.h
155	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
156cpuC.o: cpuC.c cputbl.h
157	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
158cpuD.o: cpuD.c cputbl.h
159	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
160cpuE.o: cpuE.c cputbl.h
161	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
162cpuF.o: cpuF.c cputbl.h
163	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c
164
165cpu_f0.s: cpu0.c cputbl.h cpuopti.exe
166	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
167	cpuopti <cpu-tmp.s >$@
168	del cpu-tmp.s
169cpu_f1.s: cpu1.c cputbl.h cpuopti.exe
170	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
171	cpuopti <cpu-tmp.s >$@
172	del cpu-tmp.s
173cpu_f2.s: cpu2.c cputbl.h cpuopti.exe
174	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
175	cpuopti <cpu-tmp.s >$@
176	del cpu-tmp.s
177cpu_f3.s: cpu3.c cputbl.h cpuopti.exe
178	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
179	cpuopti <cpu-tmp.s >$@
180	del cpu-tmp.s
181cpu_f4.s: cpu4.c cputbl.h cpuopti.exe
182	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
183	cpuopti <cpu-tmp.s >$@
184	del cpu-tmp.s
185cpu_f5.s: cpu5.c cputbl.h cpuopti.exe
186	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
187	cpuopti <cpu-tmp.s >$@
188	del cpu-tmp.s
189cpu_f6.s: cpu6.c cputbl.h cpuopti.exe
190	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
191	cpuopti <cpu-tmp.s >$@
192	del cpu-tmp.s
193cpu_f7.s: cpu7.c cputbl.h cpuopti.exe
194	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
195	cpuopti <cpu-tmp.s >$@
196	del cpu-tmp.s
197cpu_f8.s: cpu8.c cputbl.h cpuopti.exe
198	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
199	cpuopti <cpu-tmp.s >$@
200	del cpu-tmp.s
201cpu_f9.s: cpu9.c cputbl.h cpuopti.exe
202	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
203	cpuopti <cpu-tmp.s >$@
204	del cpu-tmp.s
205cpu_fA.s: cpuA.c cputbl.h cpuopti.exe
206	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
207	cpuopti <cpu-tmp.s >$@
208	del cpu-tmp.s
209cpu_fB.s: cpuB.c cputbl.h cpuopti.exe
210	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
211	cpuopti <cpu-tmp.s >$@
212	del cpu-tmp.s
213cpu_fC.s: cpuC.c cputbl.h cpuopti.exe
214	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
215	cpuopti <cpu-tmp.s >$@
216	del cpu-tmp.s
217cpu_fD.s: cpuD.c cputbl.h cpuopti.exe
218	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
219	cpuopti <cpu-tmp.s >$@
220	del cpu-tmp.s
221cpu_fE.s: cpuE.c cputbl.h cpuopti.exe
222	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
223	cpuopti <cpu-tmp.s >$@
224	del cpu-tmp.s
225cpu_fF.s: cpuF.c cputbl.h cpuopti.exe
226	$(CC) $(INCLUDES) -S $(CFLAGS) $< -o cpu-tmp.s
227	cpuopti <cpu-tmp.s >$@
228	del cpu-tmp.s
229
230X86.o: X86.S
231	$(CC) $(INCLUDES) -c $(CFLAGS) X86.S
232
233.m.o:
234	$(CC) $(INCLUDES) -c $(CFLAGS) $*.m
235.c.o:
236	$(CC) $(INCLUDES) -c $(CFLAGS) $*.c -o $@
237.c.s:
238	$(CC) $(INCLUDES) -S $(CFLAGS) $*.c
239.c.i:
240	$(CC) $(INCLUDES) -E $(CFLAGS) $*.c > $@
241.S.o:
242	$(CC) $(INCLUDES) -c $(CFLAGS) $*.S
243.s.o:
244	$(CC) $(INCLUDES) -c $(CFLAGS) $*.s
245
246# Saves recompiling...
247touch:
248	touch *.o
249	touch machdep\*.o
250	touch machdep\video\*.o
251	touch machdep\sound\*.o
252	touch machdep\misc\*.o
253	touch build68k.exe
254	touch cpudefs.c
255	touch gencpu.exe
256	touch cpu*.*
257
258# Some more dependencies...
259cpustbl.o: cputbl.h
260cputbl.o: cputbl.h
261
262build68k.o: include/readcpu.h
263readcpu.o: include/readcpu.h
264
265main.o: config.h
266cia.o: config.h include/events.h
267custom.o: config.h include/events.h
268newcpu.o: config.h include/events.h
269autoconf.o: config.h
270expansion.o: config.h
271xwin.o: config.h
272svga.o: config.h
273bebox.o: config.h
274os.o: config.h
275memory.o: config.h
276debug.o: config.h
277fpp.o: config.h
278ersatz.o: config.h
279filesys.o: config.h
280execlib.o: config.h
281disk.o: config.h include/events.h
282blitter.o: config.h include/events.h
283
284config.h: ../config.h
285	copy ..\config.h
286