|
|
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:
! 63: MODEL = -mshort
! 64:
! 65: LIBS = -liio16
! 66:
! 67:
! 68:
! 69: # add -DEZMINT for smaller MiNT
! 70:
! 71:
! 72:
! 73: DEFS = -DFASTTEXT -DOWN_LIB
1.1 root 74:
75:
76:
77: #
78:
1.1.1.2 ! root 79: # if you have an older version of gcc, it won't understand -G;
1.1 root 80:
1.1.1.2 ! root 81: # that won't hurt anything (it just controls the format of the
1.1 root 82:
1.1.1.2 ! root 83: # symbol table) so just delete the -G. Do *not* change it into
1.1 root 84:
1.1.1.2 ! root 85: # -g!!!
1.1 root 86:
1.1.1.2 ! root 87: #
1.1 root 88:
1.1.1.2 ! root 89: CFLAGS = -G -Wall -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
1.1 root 90:
91:
92:
93:
94:
95: COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
96:
97: filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
98:
99: biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
100:
101: unifs.o shmfs.o fasttext.o
102:
103:
104:
105: CSRCS = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
106:
107: filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
108:
109: biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
110:
111: unifs.c shmfs.c fasttext.c
112:
113:
114:
1.1.1.2 ! root 115: SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
1.1 root 116:
117:
118:
119: OBJS = $(COBJS) $(SOBJS)
120:
121:
122:
123: mint.prg: $(OBJS)
124:
125: $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
126:
127:
128:
129: $(SOBJS): proc.h
130:
131: $(COBJS): mint.h proc.h file.h
132:
133:
134:
135: main.o: version.h
136:
1.1.1.2 ! root 137: bios.o: inline.h
! 138:
1.1 root 139:
140:
141: #
142:
1.1.1.2 ! root 143: # assembler source files are now handled in a radically different
! 144:
! 145: # fashion. We build a pre-processor program, asmtrans, that
! 146:
! 147: # takes the .spp files, merges them with an include file that
! 148:
! 149: # gives various offsets into structures of interest, and produces
! 150:
! 151: # the .s files as output. This has two major advantages:
! 152:
! 153: # (1) it lets us use the same source for both the Lattice and
! 154:
! 155: # gcc assembler files (the translator will convert), and
! 156:
! 157: # (2) if we change the CONTEXT or PROC structures, we don't
! 158:
! 159: # have to dig through the source code looking for
! 160:
! 161: # magic numbers
! 162:
! 163:
! 164:
! 165: # the asm translator program
! 166:
! 167: # Note that this must be compiled with the native CC of whatever
! 168:
! 169: # system you're using; see the definitions at the top of this
! 170:
! 171: # file.
! 172:
! 173:
! 174:
! 175: ATRANSOBJ = asmtab.o trutil.o trans.o
! 176:
! 177: ATRANS = asmtrans.ttp
! 178:
! 179:
! 180:
! 181: $(ATRANS): $(ATRANSOBJ)
! 182:
! 183: $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
! 184:
! 185: $(NATIVELIBS)
1.1 root 186:
187:
188:
1.1.1.2 ! root 189: asmtab.o: asmtab.c asmtrans.h
1.1 root 190:
1.1.1.2 ! root 191: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
1.1 root 192:
193:
194:
1.1.1.2 ! root 195: trutil.o: trutil.c asmtrans.h
1.1 root 196:
1.1.1.2 ! root 197: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
1.1 root 198:
199:
200:
1.1.1.2 ! root 201: trans.o: trans.c asmtrans.h
1.1 root 202:
1.1.1.2 ! root 203: $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
1.1 root 204:
205:
206:
207:
208:
1.1.1.2 ! root 209: asmtab.c asmtab.h: asm.y
1.1 root 210:
1.1.1.2 ! root 211: $(YACC) asm.y
1.1 root 212:
1.1.1.2 ! root 213: mv $(YTABC) asmtab.c
1.1 root 214:
1.1.1.2 ! root 215: mv $(YTABH) asmtab.h
1.1 root 216:
217:
1.1.1.2 ! root 218:
! 219: # the magic number include file is generated automagically
! 220:
! 221: # NOTE that of course, magic.i can only reliably be generated
! 222:
! 223: # on an Atari ST; if you're cross-compiling, you'll have
! 224:
! 225: # to edit magic.i by hand
! 226:
! 227: # for cross compilers; uncomment the following definitions
! 228:
! 229: # and comment out the other ones below
! 230:
! 231:
! 232:
! 233: # for cross-compiling
! 234:
! 235:
! 236:
! 237: # GENMAGICPRG=echo
! 238:
! 239: # magic.i: proc.h file.h genmagic.c
! 240:
! 241: # echo "Warning: magic.i may be out of date"
! 242:
! 243:
! 244:
! 245: #for native compiling
! 246:
! 247:
! 248:
! 249: GENMAGICPRG=genmagic.ttp
! 250:
! 251:
! 252:
! 253: $(GENMAGICPRG): genmagic.c proc.h file.h
! 254:
! 255: $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
! 256:
! 257:
! 258:
! 259: magic.i: $(GENMAGICPRG)
! 260:
! 261: $(GENMAGICPRG) $@
! 262:
! 263:
! 264:
! 265: #
! 266:
! 267: # assembler source files
! 268:
! 269: #
! 270:
! 271: .SUFFIXES: .spp
! 272:
! 273:
! 274:
! 275: .spp.s:
! 276:
! 277: $(ATRANS) -gas -o $@ $<
! 278:
! 279:
! 280:
! 281: context.o: context.spp magic.i $(ATRANS)
! 282:
! 283: intr.o: intr.spp magic.i $(ATRANS)
! 284:
! 285: syscall.o: syscall.spp magic.i $(ATRANS)
! 286:
! 287: quickzer.o: quickzer.spp $(ATRANS)
! 288:
! 289: quickmov.o: quickmov.spp $(ATRANS)
! 290:
! 291: cpu.o: cpu.spp $(ATRANS)
1.1 root 292:
293:
294:
295: #
296:
297: # mkptypes generates prototypes from C source code. If you don't have it,
298:
299: # you'll have to add/delete function prototypes by hand.
300:
301: # also: Sozobon users will have to edit proto.h by hand to change the
302:
303: # #if defined(__STDC__) || defined(__cplusplus)
304:
305: # line into
306:
307: # #if __STDC__
308:
309: #
310:
311: proto.h: $(CSRCS)
312:
313: mkptypes $(CSRCS) >proto.h
314:
1.1.1.2 ! root 315:
! 316:
! 317: #
! 318:
! 319: # macros for cleaning up
! 320:
! 321: #
! 322:
! 323: GENFILES= $(OBJS) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
! 324:
! 325: EXTRAS= asmtab.c asmtab.h mint.prg
! 326:
! 327:
! 328:
! 329: clean:
! 330:
! 331: $(RM) $(GENFILES)
! 332:
! 333:
! 334:
! 335: realclean:
! 336:
! 337: $(RM) $(GENFILES) $(EXTRAS)
! 338:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.