Annotation of MiNT/src/makefile, revision 1.1.1.6

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: 
1.1.1.6 ! root       87: # add -DFASTTEXT for the u:\dev\fasttext fast console driver
1.1.1.2   root       88: 
1.1.1.4   root       89: 
1.1.1.2   root       90: 
1.1.1.6 ! root       91: DEFS = -DDEBUG_INFO
1.1.1.3   root       92: 
1.1.1.6 ! root       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.6 ! root      109: CFLAGS = -G -Wall -Wmissing-prototypes -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
1.1       root      110: 
1.1.1.3   root      111: ASFLAGS = $(MODEL)
                    112: 
1.1.1.6 ! root      113: CFLAGS030 = -G -Wall -Wmissing-prototypes -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.6 ! root      149: HFILES = assert.h atarierr.h basepage.h cookie.h ctype.h debug.h fasttext.h \
1.1.1.4   root      150: 
1.1.1.6 ! root      151:        file.h inline.h loadave.h mem.h mint.h proc.h proto.h signal.h sproto.h \
1.1.1.4   root      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: 
1.1.1.6 ! root      197: $(COBJS): mint.h proc.h file.h debug.h
1.1       root      198: 
                    199: 
                    200: 
1.1.1.3   root      201: $(SOBJS030): proc.h
                    202: 
1.1.1.6 ! root      203: $(COBJS030): mint.h proc.h file.h debug.h
1.1.1.3   root      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.1.6 ! root      213: proc.o dos.o: loadave.h
        !           214: 
1.1       root      215: 
                    216: 
1.1.1.3   root      217: memprot.o: memprot.c mint.h proc.h file.h
                    218: 
                    219:        $(CC) $(CFLAGS) -m68020 -c memprot.c
                    220: 
                    221: 
                    222: 
                    223: main.o0: version.h
                    224: 
                    225: welcome.o0: version.h
                    226: 
                    227: bios.o0: inline.h
                    228: 
1.1.1.6 ! root      229: proc.o0 dos.o0: loadave.h
        !           230: 
1.1.1.3   root      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.5   root      271: ATRANSSRC = asm.y asmtab.c asmtab.h asmtrans.h trutil.c trans.c
1.1.1.4   root      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: 
1.1.1.6 ! root      315: #
        !           316: 
1.1.1.2   root      317: # NOTE that of course, magic.i can only reliably be generated
                    318: 
                    319: # on an Atari ST; if you're cross-compiling, you'll have
                    320: 
1.1.1.6 ! root      321: # to edit magic.i by hand (unless your machine's native compiler
        !           322: 
        !           323: # happens to generate exactly the same offsets for structures as
        !           324: 
        !           325: # its Atari cross compiler, which is *extremely* unlikely).
        !           326: 
        !           327: # magic.i only needs to be updated if the structures in proc.h
        !           328: 
        !           329: # change; otherwise, you can use the supplied magic.i.
        !           330: 
        !           331: # If you do need to generate a new magic.i, cross-compile genmagic.ttp,
        !           332: 
        !           333: # run it on an ST, and bring the output back to your cross compiler.
        !           334: 
        !           335: #
1.1.1.2   root      336: 
                    337: # for cross compilers; uncomment the following definitions
                    338: 
                    339: # and comment out the other ones below
                    340: 
                    341: 
                    342: 
                    343: # for cross-compiling
                    344: 
                    345: 
                    346: 
                    347: # GENMAGICPRG=echo
                    348: 
                    349: # magic.i: proc.h file.h genmagic.c
                    350: 
                    351: #      echo "Warning: magic.i may be out of date"
                    352: 
                    353: 
                    354: 
                    355: #for native compiling
                    356: 
                    357: 
                    358: 
                    359: GENMAGICPRG=genmagic.ttp
                    360: 
                    361: 
                    362: 
                    363: $(GENMAGICPRG): genmagic.c proc.h file.h
                    364: 
                    365:        $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
                    366: 
                    367: 
                    368: 
                    369: magic.i: $(GENMAGICPRG)
                    370: 
                    371:        $(GENMAGICPRG) $@
                    372: 
                    373: 
                    374: 
                    375: #
                    376: 
                    377: # assembler source files
                    378: 
                    379: #
                    380: 
1.1.1.3   root      381: .SUFFIXES: .spp .o0
                    382: 
                    383: 
                    384: 
                    385: .spp.o:
1.1.1.2   root      386: 
1.1.1.3   root      387:        $(ATRANS) $(DEFS) -gas -o $*.s $<
1.1.1.2   root      388: 
1.1.1.3   root      389:        $(AS) $(ASFLAGS) -o $@ -c $*.s
1.1.1.2   root      390: 
1.1.1.3   root      391:        $(RM) $*.s
1.1.1.2   root      392: 
1.1.1.3   root      393: .spp.o0:
                    394: 
                    395:        $(ATRANS) $(DEFS030) -gas -o $*.s $<
                    396: 
                    397:        $(AS) $(ASFLAGS0) -o $@ -c $*.s
                    398: 
                    399:        $(RM) $*.s
                    400: 
                    401: .c.o0:
                    402: 
                    403:        $(CC) $(CFLAGS030) -o $@ -c $<
1.1.1.2   root      404: 
                    405: 
                    406: 
                    407: context.o: context.spp magic.i $(ATRANS)
                    408: 
                    409: intr.o: intr.spp magic.i $(ATRANS)
                    410: 
                    411: syscall.o: syscall.spp magic.i $(ATRANS)
                    412: 
                    413: quickzer.o: quickzer.spp $(ATRANS)
                    414: 
                    415: quickmov.o: quickmov.spp $(ATRANS)
                    416: 
                    417: cpu.o: cpu.spp $(ATRANS)
1.1       root      418: 
                    419: 
                    420: 
1.1.1.3   root      421: context.o0: context.spp magic.i $(ATRANS)
                    422: 
                    423: intr.o0: intr.spp magic.i $(ATRANS)
                    424: 
                    425: syscall.o0: syscall.spp magic.i $(ATRANS)
                    426: 
                    427: quickzer.o0: quickzer.spp $(ATRANS)
                    428: 
                    429: quickmov.o0: quickmov.spp $(ATRANS)
                    430: 
                    431: cpu.o0: cpu.spp $(ATRANS)
                    432: 
                    433: 
                    434: 
1.1       root      435: #
                    436: 
                    437: # mkptypes generates prototypes from C source code. If you don't have it,
                    438: 
                    439: # you'll have to add/delete function prototypes by hand.
                    440: 
                    441: # also: Sozobon users will have to edit proto.h by hand to change the
                    442: 
                    443: #    #if defined(__STDC__) || defined(__cplusplus)
                    444: 
                    445: # line into
                    446: 
                    447: #    #if __STDC__
                    448: 
                    449: #
                    450: 
1.1.1.4   root      451: proto.h: $(CFILES)
1.1       root      452: 
1.1.1.4   root      453:        mkptypes $(CFILES) >proto.h
1.1       root      454: 
1.1.1.2   root      455: 
                    456: 
                    457: #
                    458: 
                    459: # macros for cleaning up
                    460: 
                    461: #
                    462: 
1.1.1.3   root      463: GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
1.1.1.2   root      464: 
                    465: EXTRAS= asmtab.c asmtab.h mint.prg
                    466: 
                    467: 
                    468: 
                    469: clean:
                    470: 
                    471:        $(RM) $(GENFILES)
                    472: 
                    473: 
                    474: 
                    475: realclean:
                    476: 
                    477:        $(RM) $(GENFILES) $(EXTRAS)
                    478: 
1.1.1.4   root      479: 
                    480: 
                    481: #
                    482: 
                    483: # misc. files and subdirectories to include in the distribution
                    484: 
                    485: #
                    486: 
1.1.1.6 ! root      487: MISCFILES = copying readme.src changes makefile makefile.lcc mintlc.prj \
1.1.1.4   root      488: 
                    489:        genmagic.c purec asmtrans.ttp
                    490: 
                    491: 
                    492: 
                    493: #
                    494: 
                    495: # macros for making distribution packages
                    496: 
                    497: #
                    498: 
                    499: 
                    500: 
                    501: dist:
                    502: 
                    503:        zoo a//h mintsrc.zoo $(MISCFILES) $(CFILES) $(HFILES) $(SFILES) \
                    504: 
                    505:         $(ATRANSSRC)
                    506: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.