Annotation of MiNT/src/purec/makefile, revision 1.1.1.3

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

unix.superglobalmegacorp.com

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