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