|
|
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.3 root 183: prgflags 7 7 mint.prg
184:
185: strip mint.prg
186:
187:
188:
189: mint030.prg: $(OBJS030)
190:
191: $(CC) $(CFLAGS030) -o mint030.prg $(OBJS030) $(LIBS)
192:
193: prgflags 7 7 mint030.prg
194:
195: strip mint030.prg
196:
1.1 root 197:
198:
199: $(SOBJS): proc.h
200:
201: $(COBJS): mint.h proc.h file.h
202:
203:
204:
1.1.1.3 root 205: $(SOBJS030): proc.h
206:
207: $(COBJS030): mint.h proc.h file.h
208:
209:
210:
1.1 root 211: main.o: version.h
212:
1.1.1.3 root 213: welcome.o: version.h
214:
1.1.1.2 root 215: bios.o: inline.h
216:
1.1 root 217:
218:
1.1.1.3 root 219: memprot.o: memprot.c mint.h proc.h file.h
220:
221: $(CC) $(CFLAGS) -m68020 -c memprot.c
222:
223:
224:
225: main.o0: version.h
226:
227: welcome.o0: version.h
228:
229: bios.o0: inline.h
230:
231:
232:
1.1 root 233: #
234:
1.1.1.2 root 235: # assembler source files are now handled in a radically different
236:
237: # fashion. We build a pre-processor program, asmtrans, that
238:
239: # takes the .spp files, merges them with an include file that
240:
241: # gives various offsets into structures of interest, and produces
242:
243: # the .s files as output. This has two major advantages:
244:
245: # (1) it lets us use the same source for both the Lattice and
246:
247: # gcc assembler files (the translator will convert), and
248:
249: # (2) if we change the CONTEXT or PROC structures, we don't
250:
251: # have to dig through the source code looking for
252:
253: # magic numbers
254:
255:
256:
257: # the asm translator program
258:
259: # Note that this must be compiled with the native CC of whatever
260:
261: # system you're using; see the definitions at the top of this
262:
263: # file.
264:
265:
266:
267: ATRANSOBJ = asmtab.o trutil.o trans.o
268:
269: ATRANS = asmtrans.ttp
270:
1.1.1.4 ! root 271: ATRANSSRC = asm.y amstab.c asmtab.h asmtrans.h trutil.c trans.c
! 272:
1.1.1.2 root 273:
274:
275: $(ATRANS): $(ATRANSOBJ)
276:
277: $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
278:
279: $(NATIVELIBS)
1.1 root 280:
281:
282:
1.1.1.2 root 283: asmtab.o: asmtab.c asmtrans.h
1.1 root 284:
1.1.1.3 root 285: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c asmtab.c
1.1 root 286:
287:
288:
1.1.1.2 root 289: trutil.o: trutil.c asmtrans.h
1.1 root 290:
1.1.1.3 root 291: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trutil.c
1.1 root 292:
293:
294:
1.1.1.2 root 295: trans.o: trans.c asmtrans.h
1.1 root 296:
1.1.1.3 root 297: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trans.c
1.1 root 298:
299:
300:
301:
302:
1.1.1.2 root 303: asmtab.c asmtab.h: asm.y
1.1 root 304:
1.1.1.4 ! root 305: $(YACC) -d asm.y
1.1 root 306:
1.1.1.2 root 307: mv $(YTABC) asmtab.c
1.1 root 308:
1.1.1.2 root 309: mv $(YTABH) asmtab.h
1.1 root 310:
311:
1.1.1.2 root 312:
313: # the magic number include file is generated automagically
314:
315: # NOTE that of course, magic.i can only reliably be generated
316:
317: # on an Atari ST; if you're cross-compiling, you'll have
318:
319: # to edit magic.i by hand
320:
321: # for cross compilers; uncomment the following definitions
322:
323: # and comment out the other ones below
324:
325:
326:
327: # for cross-compiling
328:
329:
330:
331: # GENMAGICPRG=echo
332:
333: # magic.i: proc.h file.h genmagic.c
334:
335: # echo "Warning: magic.i may be out of date"
336:
337:
338:
339: #for native compiling
340:
341:
342:
343: GENMAGICPRG=genmagic.ttp
344:
345:
346:
347: $(GENMAGICPRG): genmagic.c proc.h file.h
348:
349: $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
350:
351:
352:
353: magic.i: $(GENMAGICPRG)
354:
355: $(GENMAGICPRG) $@
356:
357:
358:
359: #
360:
361: # assembler source files
362:
363: #
364:
1.1.1.3 root 365: .SUFFIXES: .spp .o0
366:
367:
368:
369: .spp.o:
1.1.1.2 root 370:
1.1.1.3 root 371: $(ATRANS) $(DEFS) -gas -o $*.s $<
1.1.1.2 root 372:
1.1.1.3 root 373: $(AS) $(ASFLAGS) -o $@ -c $*.s
1.1.1.2 root 374:
1.1.1.3 root 375: $(RM) $*.s
1.1.1.2 root 376:
1.1.1.3 root 377: .spp.o0:
378:
379: $(ATRANS) $(DEFS030) -gas -o $*.s $<
380:
381: $(AS) $(ASFLAGS0) -o $@ -c $*.s
382:
383: $(RM) $*.s
384:
385: .c.o0:
386:
387: $(CC) $(CFLAGS030) -o $@ -c $<
1.1.1.2 root 388:
389:
390:
391: context.o: context.spp magic.i $(ATRANS)
392:
393: intr.o: intr.spp magic.i $(ATRANS)
394:
395: syscall.o: syscall.spp magic.i $(ATRANS)
396:
397: quickzer.o: quickzer.spp $(ATRANS)
398:
399: quickmov.o: quickmov.spp $(ATRANS)
400:
401: cpu.o: cpu.spp $(ATRANS)
1.1 root 402:
403:
404:
1.1.1.3 root 405: context.o0: context.spp magic.i $(ATRANS)
406:
407: intr.o0: intr.spp magic.i $(ATRANS)
408:
409: syscall.o0: syscall.spp magic.i $(ATRANS)
410:
411: quickzer.o0: quickzer.spp $(ATRANS)
412:
413: quickmov.o0: quickmov.spp $(ATRANS)
414:
415: cpu.o0: cpu.spp $(ATRANS)
416:
417:
418:
1.1 root 419: #
420:
421: # mkptypes generates prototypes from C source code. If you don't have it,
422:
423: # you'll have to add/delete function prototypes by hand.
424:
425: # also: Sozobon users will have to edit proto.h by hand to change the
426:
427: # #if defined(__STDC__) || defined(__cplusplus)
428:
429: # line into
430:
431: # #if __STDC__
432:
433: #
434:
1.1.1.4 ! root 435: proto.h: $(CFILES)
1.1 root 436:
1.1.1.4 ! root 437: mkptypes $(CFILES) >proto.h
1.1 root 438:
1.1.1.2 root 439:
440:
441: #
442:
443: # macros for cleaning up
444:
445: #
446:
1.1.1.3 root 447: GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
1.1.1.2 root 448:
449: EXTRAS= asmtab.c asmtab.h mint.prg
450:
451:
452:
453: clean:
454:
455: $(RM) $(GENFILES)
456:
457:
458:
459: realclean:
460:
461: $(RM) $(GENFILES) $(EXTRAS)
462:
1.1.1.4 ! root 463:
! 464:
! 465: #
! 466:
! 467: # misc. files and subdirectories to include in the distribution
! 468:
! 469: #
! 470:
! 471: MISCFILES = copying readme changes makefile makefile.lcc mintlc.prj \
! 472:
! 473: genmagic.c purec asmtrans.ttp
! 474:
! 475:
! 476:
! 477: #
! 478:
! 479: # macros for making distribution packages
! 480:
! 481: #
! 482:
! 483:
! 484:
! 485: dist:
! 486:
! 487: zoo a//h mintsrc.zoo $(MISCFILES) $(CFILES) $(HFILES) $(SFILES) \
! 488:
! 489: $(ATRANSSRC)
! 490:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.