|
|
1.1 root 1: #
2:
3: # Makefile for MiNT using the GCC
4:
5: #
6:
7:
8:
1.1.1.2 root 9: # if you're cross-compiling, define NATIVECC
1.1 root 10:
1.1.1.2 root 11: # to the host's C compiler, NATIVECFLAGS to
1.1 root 12:
1.1.1.2 root 13: # the appropriate flags for it, and NATIVELIBS
1.1 root 14:
1.1.1.2 root 15: # to appropriate libraries
1.1 root 16:
1.1.1.2 root 17: # NATIVECC = cc -DNO_STDLIB
1.1 root 18:
1.1.1.2 root 19: # NATIVECFLAGS = -g
1.1 root 20:
1.1.1.2 root 21: # NATIVELIBS =
1.1 root 22:
23:
24:
1.1.1.2 root 25: NATIVECC = gcc
1.1 root 26:
1.1.1.2 root 27: NATIVECFLAGS = -O
1.1 root 28:
1.1.1.2 root 29: NATIVELIBS = -liio
1.1 root 30:
31:
32:
33: #
34:
1.1.1.2 root 35: # depending on your version of bison/yacc, you may
36:
37: # need to change these names, e.g. to
38:
39: # YACC = yacc
40:
41: # YTABC = y.tab.c
42:
43: # YTABH = y.tab.h
44:
45:
46:
1.1.1.4 root 47: #YACC = bison
1.1.1.2 root 48:
1.1.1.4 root 49: #YTABC = asm_tab.c
1.1.1.2 root 50:
1.1.1.4 root 51: #YTABH = asm_tab.h
52:
53:
54:
55: YACC = byacc -b y_
56:
57: YTABC = y_tab.c
58:
59: YTABH = y_tab.h
1.1.1.2 root 60:
61:
62:
63: # here are defs for the cross compiler
64:
65: # MiNT must be compiled with 16 bit integers
66:
67:
68:
69: CC = gcc
70:
1.1.1.3 root 71: AS = gcc
72:
1.1.1.2 root 73: MODEL = -mshort
74:
1.1.1.3 root 75: MODEL030 = -mshort -m68020
76:
1.1.1.2 root 77: LIBS = -liio16
78:
79:
80:
1.1.1.3 root 81: # add -DMULTITOS for a MultiTOS kernel
82:
83: # add -DONLY030 for a version of MiNT that needs a 680x0, x>=3
84:
1.1.1.4 root 85: # add -DDEBUG_INFO for debugging information
1.1.1.2 root 86:
87:
1.1.1.4 root 88:
89: DEFS = -DMULTITOS -DDEBUG_INFO
1.1.1.2 root 90:
1.1.1.3 root 91: #DEFS030 = -DMULTITOS -DONLY030
92:
93: DEFS030 = -DONLY030
1.1 root 94:
95:
96:
97: #
98:
1.1.1.2 root 99: # if you have an older version of gcc, it won't understand -G;
1.1 root 100:
1.1.1.2 root 101: # that won't hurt anything (it just controls the format of the
1.1 root 102:
1.1.1.2 root 103: # symbol table) so just delete the -G. Do *not* change it into
1.1 root 104:
1.1.1.2 root 105: # -g!!!
1.1 root 106:
1.1.1.2 root 107: #
1.1 root 108:
1.1.1.2 root 109: CFLAGS = -G -Wall -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
1.1 root 110:
1.1.1.3 root 111: ASFLAGS = $(MODEL)
112:
113: CFLAGS030 = -G -Wall -O2 -fomit-frame-pointer $(MODEL030) $(DEFS030)
1.1 root 114:
1.1.1.3 root 115: ASFLAGS030 = $(MODEL030)
1.1 root 116:
117:
118:
119: COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
120:
121: filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
122:
123: biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
124:
1.1.1.3 root 125: unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
126:
127:
128:
129: COBJS030 = bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 dossig.o0 \
130:
131: filesys.o0 main.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
132:
133: biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
134:
135: unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0
1.1 root 136:
137:
138:
1.1.1.4 root 139: CFILES = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
1.1 root 140:
141: filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
142:
143: biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
144:
1.1.1.3 root 145: unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c
1.1 root 146:
147:
148:
1.1.1.4 root 149: HFILES = assert.h atarierr.h basepage.h cookie.h ctype.h fasttext.h \
150:
151: file.h inline.h mem.h mint.h proc.h proto.h signal.h sproto.h \
152:
153: types.h version.h xbra.h
154:
155:
156:
157: SFILES = context.spp cpu.spp intr.spp syscall.spp quickzer.spp \
158:
159: quickmov.spp magic.i
160:
161:
162:
1.1.1.2 root 163: SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
1.1 root 164:
1.1.1.3 root 165: SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
166:
1.1 root 167:
168:
169: OBJS = $(COBJS) $(SOBJS)
170:
1.1.1.3 root 171: OBJS030 = $(COBJS030) $(SOBJS030)
172:
173:
174:
1.1.1.4 root 175: #all: mint.prg mint030.prg
1.1.1.3 root 176:
1.1 root 177:
178:
179: mint.prg: $(OBJS)
180:
181: $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
182:
1.1.1.5 ! root 183: # strip mint.prg
1.1.1.3 root 184:
185:
186:
187: mint030.prg: $(OBJS030)
188:
189: $(CC) $(CFLAGS030) -o mint030.prg $(OBJS030) $(LIBS)
190:
1.1.1.5 ! root 191: # strip mint030.prg
1.1.1.3 root 192:
1.1 root 193:
194:
195: $(SOBJS): proc.h
196:
197: $(COBJS): mint.h proc.h file.h
198:
199:
200:
1.1.1.3 root 201: $(SOBJS030): proc.h
202:
203: $(COBJS030): mint.h proc.h file.h
204:
205:
206:
1.1 root 207: main.o: version.h
208:
1.1.1.3 root 209: welcome.o: version.h
210:
1.1.1.2 root 211: bios.o: inline.h
212:
1.1 root 213:
214:
1.1.1.3 root 215: memprot.o: memprot.c mint.h proc.h file.h
216:
217: $(CC) $(CFLAGS) -m68020 -c memprot.c
218:
219:
220:
221: main.o0: version.h
222:
223: welcome.o0: version.h
224:
225: bios.o0: inline.h
226:
227:
228:
1.1 root 229: #
230:
1.1.1.2 root 231: # assembler source files are now handled in a radically different
232:
233: # fashion. We build a pre-processor program, asmtrans, that
234:
235: # takes the .spp files, merges them with an include file that
236:
237: # gives various offsets into structures of interest, and produces
238:
239: # the .s files as output. This has two major advantages:
240:
241: # (1) it lets us use the same source for both the Lattice and
242:
243: # gcc assembler files (the translator will convert), and
244:
245: # (2) if we change the CONTEXT or PROC structures, we don't
246:
247: # have to dig through the source code looking for
248:
249: # magic numbers
250:
251:
252:
253: # the asm translator program
254:
255: # Note that this must be compiled with the native CC of whatever
256:
257: # system you're using; see the definitions at the top of this
258:
259: # file.
260:
261:
262:
263: ATRANSOBJ = asmtab.o trutil.o trans.o
264:
265: ATRANS = asmtrans.ttp
266:
1.1.1.5 ! root 267: ATRANSSRC = asm.y asmtab.c asmtab.h asmtrans.h trutil.c trans.c
1.1.1.4 root 268:
1.1.1.2 root 269:
270:
271: $(ATRANS): $(ATRANSOBJ)
272:
273: $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
274:
275: $(NATIVELIBS)
1.1 root 276:
277:
278:
1.1.1.2 root 279: asmtab.o: asmtab.c asmtrans.h
1.1 root 280:
1.1.1.3 root 281: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c asmtab.c
1.1 root 282:
283:
284:
1.1.1.2 root 285: trutil.o: trutil.c asmtrans.h
1.1 root 286:
1.1.1.3 root 287: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trutil.c
1.1 root 288:
289:
290:
1.1.1.2 root 291: trans.o: trans.c asmtrans.h
1.1 root 292:
1.1.1.3 root 293: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trans.c
1.1 root 294:
295:
296:
297:
298:
1.1.1.2 root 299: asmtab.c asmtab.h: asm.y
1.1 root 300:
1.1.1.4 root 301: $(YACC) -d asm.y
1.1 root 302:
1.1.1.2 root 303: mv $(YTABC) asmtab.c
1.1 root 304:
1.1.1.2 root 305: mv $(YTABH) asmtab.h
1.1 root 306:
307:
1.1.1.2 root 308:
309: # the magic number include file is generated automagically
310:
311: # NOTE that of course, magic.i can only reliably be generated
312:
313: # on an Atari ST; if you're cross-compiling, you'll have
314:
315: # to edit magic.i by hand
316:
317: # for cross compilers; uncomment the following definitions
318:
319: # and comment out the other ones below
320:
321:
322:
323: # for cross-compiling
324:
325:
326:
327: # GENMAGICPRG=echo
328:
329: # magic.i: proc.h file.h genmagic.c
330:
331: # echo "Warning: magic.i may be out of date"
332:
333:
334:
335: #for native compiling
336:
337:
338:
339: GENMAGICPRG=genmagic.ttp
340:
341:
342:
343: $(GENMAGICPRG): genmagic.c proc.h file.h
344:
345: $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
346:
347:
348:
349: magic.i: $(GENMAGICPRG)
350:
351: $(GENMAGICPRG) $@
352:
353:
354:
355: #
356:
357: # assembler source files
358:
359: #
360:
1.1.1.3 root 361: .SUFFIXES: .spp .o0
362:
363:
364:
365: .spp.o:
1.1.1.2 root 366:
1.1.1.3 root 367: $(ATRANS) $(DEFS) -gas -o $*.s $<
1.1.1.2 root 368:
1.1.1.3 root 369: $(AS) $(ASFLAGS) -o $@ -c $*.s
1.1.1.2 root 370:
1.1.1.3 root 371: $(RM) $*.s
1.1.1.2 root 372:
1.1.1.3 root 373: .spp.o0:
374:
375: $(ATRANS) $(DEFS030) -gas -o $*.s $<
376:
377: $(AS) $(ASFLAGS0) -o $@ -c $*.s
378:
379: $(RM) $*.s
380:
381: .c.o0:
382:
383: $(CC) $(CFLAGS030) -o $@ -c $<
1.1.1.2 root 384:
385:
386:
387: context.o: context.spp magic.i $(ATRANS)
388:
389: intr.o: intr.spp magic.i $(ATRANS)
390:
391: syscall.o: syscall.spp magic.i $(ATRANS)
392:
393: quickzer.o: quickzer.spp $(ATRANS)
394:
395: quickmov.o: quickmov.spp $(ATRANS)
396:
397: cpu.o: cpu.spp $(ATRANS)
1.1 root 398:
399:
400:
1.1.1.3 root 401: context.o0: context.spp magic.i $(ATRANS)
402:
403: intr.o0: intr.spp magic.i $(ATRANS)
404:
405: syscall.o0: syscall.spp magic.i $(ATRANS)
406:
407: quickzer.o0: quickzer.spp $(ATRANS)
408:
409: quickmov.o0: quickmov.spp $(ATRANS)
410:
411: cpu.o0: cpu.spp $(ATRANS)
412:
413:
414:
1.1 root 415: #
416:
417: # mkptypes generates prototypes from C source code. If you don't have it,
418:
419: # you'll have to add/delete function prototypes by hand.
420:
421: # also: Sozobon users will have to edit proto.h by hand to change the
422:
423: # #if defined(__STDC__) || defined(__cplusplus)
424:
425: # line into
426:
427: # #if __STDC__
428:
429: #
430:
1.1.1.4 root 431: proto.h: $(CFILES)
1.1 root 432:
1.1.1.4 root 433: mkptypes $(CFILES) >proto.h
1.1 root 434:
1.1.1.2 root 435:
436:
437: #
438:
439: # macros for cleaning up
440:
441: #
442:
1.1.1.3 root 443: GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
1.1.1.2 root 444:
445: EXTRAS= asmtab.c asmtab.h mint.prg
446:
447:
448:
449: clean:
450:
451: $(RM) $(GENFILES)
452:
453:
454:
455: realclean:
456:
457: $(RM) $(GENFILES) $(EXTRAS)
458:
1.1.1.4 root 459:
460:
461: #
462:
463: # misc. files and subdirectories to include in the distribution
464:
465: #
466:
467: MISCFILES = copying readme changes makefile makefile.lcc mintlc.prj \
468:
469: genmagic.c purec asmtrans.ttp
470:
471:
472:
473: #
474:
475: # macros for making distribution packages
476:
477: #
478:
479:
480:
481: dist:
482:
483: zoo a//h mintsrc.zoo $(MISCFILES) $(CFILES) $(HFILES) $(SFILES) \
484:
485: $(ATRANSSRC)
486:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.