Annotation of MiNT/src/makefile.lcc, revision 1.1.1.4

1.1       root        1: #
                      2: 
                      3: # Makefile for MiNT using the LCC
                      4: 
                      5: #
                      6: 
1.1.1.3   root        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 = lcc
                     26: 
                     27: NATIVECFLAGS = -O
                     28: 
                     29: NATIVELIBS =
                     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: 
                     57: # MiNT must be compiled with 16 bit integers
                     58: 
                     59: 
                     60: 
                     61: CC = lcc
                     62: 
                     63: AS = asm
1.1       root       64: 
                     65: MODEL = -w -b0 -r0 -bn -aw
                     66: 
1.1.1.3   root       67: MODEL030 = $(MODEL) -m3
                     68: 
1.1       root       69: LIBS =
                     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.4 ! root       77: # add -DDEBUG_INFO for debugging information
1.1.1.3   root       78: 
                     79: 
                     80: 
1.1.1.4 ! root       81: DEFS = -DDEBUG_INFO
        !            82: 
        !            83: DEFS030 = -DONLY030 -DDEBUG_INFO
1.1.1.3   root       84: 
                     85: 
                     86: 
                     87: SYMS = -Hmint.sym
1.1       root       88: 
1.1.1.4 ! root       89: SYMS030 = -Hmint030.sym
        !            90: 
1.1       root       91: 
                     92: 
                     93: # 30   - pointers do not point to same type of object
                     94: 
                     95: # 86   - formal definitions conflict with type list
                     96: 
                     97: # 100  - no prototype declared for function
                     98: 
                     99: # 104  - conversion from pointer to const/volatile to pointer to non-const/volatile
                    100: 
                    101: # 135  - assignment to shorter data type (precision may be lost)
                    102: 
                    103: # 154  - no prototype declared for function pointer
                    104: 
1.1.1.2   root      105: # 159  - use of unary minus on unsigned value
1.1       root      106: 
1.1.1.2   root      107: ERRORS = -j30e86e100e104e135i154e159i
1.1       root      108: 
                    109: 
                    110: 
1.1.1.4 ! root      111: OPTS = -d1 -Oloop -v -cfsb -cag -e
1.1.1.3   root      112: 
                    113: ASOPTS = -ma -m8 -d -.
1.1       root      114: 
1.1.1.3   root      115: COPTS = $(OPTS) $(MODEL) $(ERRORS) $(DEFS)
1.1       root      116: 
1.1.1.2   root      117: CFLAGS = $(COPTS) $(SYMS)
1.1       root      118: 
1.1.1.3   root      119: ASFLAGS = $(ASOPTS) $(DEFS)
                    120: 
1.1.1.4 ! root      121: COPTS030 = $(OPTS) $(MODEL030) $(ERRORS) $(DEFS030)
        !           122: 
        !           123: CFLAGS030 = $(COPTS030) $(SYMS030)
1.1.1.3   root      124: 
                    125: ASFLAGS030 = -m3 $(ASOPTS) $(DEFS030)
                    126: 
                    127: 
1.1       root      128: 
1.1.1.2   root      129: LDFLAGS = -t=
1.1       root      130: 
                    131: 
                    132: 
                    133: COBJS = main.o bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o \
                    134: 
                    135:        dossig.o filesys.o mem.o proc.o signal.o timeout.o tty.o util.o \
                    136: 
                    137:        biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
                    138: 
1.1.1.4 ! root      139:        unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
1.1.1.3   root      140: 
                    141: 
                    142: 
                    143: COBJS030 = main.o0 bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 \
                    144: 
                    145:        dossig.o0 filesys.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
                    146: 
                    147:        biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
                    148: 
                    149:        unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o0 realloc.o0
1.1       root      150: 
                    151: 
                    152: 
                    153: CSRCS = main.c bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c \
                    154: 
                    155:        dossig.c filesys.c mem.c proc.c signal.c timeout.c tty.c util.c \
                    156: 
                    157:        biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
                    158: 
1.1.1.3   root      159:        unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c
1.1       root      160: 
                    161: 
                    162: 
1.1.1.2   root      163: SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
                    164: 
1.1.1.3   root      165: SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
1.1       root      166: 
                    167: 
                    168: 
                    169: OBJS = $(COBJS) $(SOBJS)
                    170: 
1.1.1.3   root      171: OBJS030 = $(COBJS030) $(SOBJS030)
                    172: 
                    173: 
                    174: 
                    175: all: mint.prg mint030.prg
                    176: 
1.1       root      177: 
                    178: 
                    179: mint.prg: $(OBJS)
                    180: 
1.1.1.4 ! root      181:        $(CC) $(CFLAGS) -omint.prg $(LDFLAGS) $(OBJS) $(LIBS)
1.1       root      182: 
                    183: 
                    184: 
1.1.1.3   root      185: mint030.prg: $(OBJS030)
                    186: 
1.1.1.4 ! root      187:        $(CC) $(CFLAGS030) -omint030.prg $(LDFLAGS) $(OBJS030) $(LIBS)
1.1.1.3   root      188: 
                    189: 
                    190: 
                    191: $(SOBJS) $(SOBJS030): proc.h
                    192: 
1.1.1.4 ! root      193: $(COBJS): mint.sym
        !           194: 
        !           195: $(COBJS030): mint030.sym
1.1       root      196: 
                    197: 
                    198: 
                    199: main.o: version.h
                    200: 
1.1.1.3   root      201: welcome.o: version.h
                    202: 
                    203: bios.o: inline.h
                    204: 
1.1       root      205: 
                    206: 
1.1.1.4 ! root      207: memprot.o: memprot.c
        !           208: 
        !           209:        $(CC) -c $(CFLAGS) -m3 -omemprot.o memprot.c
        !           210: 
        !           211: 
        !           212: 
        !           213: main.o0: version.h
        !           214: 
        !           215: welcome.o0: version.h
        !           216: 
        !           217: bios.o0: inline.h
        !           218: 
        !           219: 
        !           220: 
        !           221: mint.sym mint030.sym: mint.h ctype.h assert.h atarierr.h basepage.h types.h \
1.1       root      222: 
1.1.1.2   root      223:        signal.h mem.h proc.h file.h sproto.h proto.h inline.h
                    224: 
1.1.1.4 ! root      225: 
        !           226: 
        !           227: mint.sym:
        !           228: 
        !           229:        $(CC) $(COPTS) -ph -omint.sym mint.h
        !           230: 
        !           231: 
        !           232: 
        !           233: mint030.sym:
        !           234: 
        !           235:        $(CC) $(COPTS030) -ph -omint030.sym mint.h
1.1.1.2   root      236: 
                    237: 
                    238: 
                    239: #
                    240: 
                    241: # assembler source files are now handled in a radically different
                    242: 
                    243: # fashion. We build a pre-processor program, asmtrans, that
                    244: 
                    245: # takes the .spp files, merges them with an include file that
                    246: 
                    247: # gives various offsets into structures of interest, and produces
                    248: 
                    249: # the .s files as output. This has two major advantages:
1.1       root      250: 
1.1.1.2   root      251: # (1) it lets us use the same source for both the Lattice and
                    252: 
                    253: #     gcc assembler files (the translator will convert), and
                    254: 
                    255: # (2) if we change the CONTEXT or PROC structures, we don't
                    256: 
                    257: #     have to dig through the source code looking for
                    258: 
                    259: #     magic numbers
                    260: 
                    261: 
                    262: 
                    263: # the asm translator program
                    264: 
1.1.1.3   root      265: # Note that this must be compiled with the native CC of whatever
1.1.1.2   root      266: 
1.1.1.3   root      267: # system you're using; see the definitions at the top of this
1.1.1.2   root      268: 
1.1.1.3   root      269: # file.
1.1.1.2   root      270: 
                    271: 
                    272: 
1.1.1.3   root      273: ATRANSOBJ = asmtab.o trutil.o trans.o
1.1.1.2   root      274: 
1.1.1.3   root      275: ATRANS = asmtrans.ttp
1.1.1.2   root      276: 
                    277: 
                    278: 
1.1.1.3   root      279: $(ATRANS): $(ATRANSOBJ)
1.1.1.2   root      280: 
1.1.1.3   root      281:        $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
1.1.1.2   root      282: 
1.1.1.3   root      283:                $(NATIVELIBS)
1.1.1.2   root      284: 
                    285: 
                    286: 
1.1.1.3   root      287: asmtab.o: asmtab.c asmtrans.h
1.1.1.2   root      288: 
1.1.1.3   root      289:        $(NATIVECC) $(NATIVECFLAGS) -o $@ -c asmtab.c
1.1.1.2   root      290: 
1.1       root      291: 
                    292: 
1.1.1.3   root      293: trutil.o: trutil.c asmtrans.h
1.1       root      294: 
1.1.1.3   root      295:        $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trutil.c
1.1       root      296: 
1.1.1.2   root      297: 
1.1       root      298: 
1.1.1.3   root      299: trans.o: trans.c asmtrans.h
                    300: 
                    301:        $(NATIVECC) $(NATIVECFLAGS) -o $@ -c trans.c
1.1.1.2   root      302: 
                    303: 
                    304: 
                    305: 
                    306: 
                    307: asmtab.c asmtab.h:     asm.y
                    308: 
                    309:        $(YACC) asm.y
                    310: 
                    311:        mv $(YTABC) asmtab.c
                    312: 
                    313:        mv $(YTABH) asmtab.h
                    314: 
                    315: 
                    316: 
                    317: # the magic number include file is generated automagically
                    318: 
1.1.1.3   root      319: # NOTE that of course, magic.i can only reliably be generated
                    320: 
                    321: # on an Atari ST; if you're cross-compiling, you'll have
                    322: 
                    323: # to edit magic.i by hand
                    324: 
                    325: # for cross compilers; uncomment the following definitions
                    326: 
                    327: # and comment out the other ones below
                    328: 
                    329: 
                    330: 
                    331: # for cross-compiling
1.1.1.2   root      332: 
                    333: 
                    334: 
1.1.1.3   root      335: # GENMAGICPRG=echo
1.1.1.2   root      336: 
1.1.1.3   root      337: # magic.i: proc.h file.h genmagic.c
1.1.1.2   root      338: 
1.1.1.3   root      339: #      echo "Warning: magic.i may be out of date"
1.1.1.2   root      340: 
                    341: 
1.1.1.3   root      342: 
                    343: #for native compiling
                    344: 
                    345: 
                    346: 
                    347: GENMAGICPRG=genmagic.ttp
                    348: 
                    349: 
                    350: 
                    351: $(GENMAGICPRG): genmagic.c proc.h file.h
                    352: 
                    353:        $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
                    354: 
                    355: 
                    356: 
                    357: magic.i: $(GENMAGICPRG)
                    358: 
                    359:        $(GENMAGICPRG) $@
1.1.1.2   root      360: 
                    361: 
                    362: 
                    363: #
                    364: 
                    365: # assembler source files
1.1       root      366: 
                    367: #
                    368: 
1.1.1.3   root      369: .SUFFIXES: .spp .o0
1.1.1.2   root      370: 
1.1       root      371: 
                    372: 
1.1.1.2   root      373: .spp.o:
1.1       root      374: 
1.1.1.3   root      375:        $(ATRANS) $(DEFS) -asm -o $*.s $<
1.1       root      376: 
1.1.1.2   root      377:        $(AS) $(ASFLAGS) -o$@ $*.s
1.1       root      378: 
1.1.1.2   root      379:        $(RM) $*.s
1.1       root      380: 
1.1.1.3   root      381: .spp.o0:
                    382: 
                    383:        $(ATRANS) $(DEFS030) -asm -o $*.s $<
                    384: 
                    385:        $(AS) $(ASFLAGS030) -o__asm.o $*.s
                    386: 
                    387:        mv __asm.o $@
1.1       root      388: 
1.1.1.3   root      389:        $(RM) $*.s
1.1       root      390: 
1.1.1.2   root      391: .spp.s:
1.1       root      392: 
1.1.1.3   root      393:        $(ATRANS) $(DEFS) -asm -o $@ $<
1.1       root      394: 
1.1.1.3   root      395: .c.o0:
1.1       root      396: 
1.1.1.3   root      397:        $(CC) -c $(CFLAGS030) -o$@ $<
1.1       root      398: 
                    399: 
                    400: 
1.1.1.4 ! root      401: context.o context.o0: context.spp magic.i $(ATRANS)
1.1       root      402: 
1.1.1.4 ! root      403: intr.o intr.o0: intr.spp magic.i $(ATRANS)
1.1       root      404: 
1.1.1.4 ! root      405: syscall.o syscall.o0: syscall.spp magic.i $(ATRANS)
1.1.1.2   root      406: 
1.1.1.4 ! root      407: quickzer.o quickzer.o0: quickzer.spp $(ATRANS)
1.1.1.2   root      408: 
1.1.1.4 ! root      409: quickmov.o quickmov.o0: quickmov.spp $(ATRANS)
1.1       root      410: 
1.1.1.4 ! root      411: cpu.o cpu.o0: cpu.spp $(ATRANS)
1.1       root      412: 
                    413: 
                    414: 
                    415: #
                    416: 
1.1.1.3   root      417: # mkptypes generates prototypes from C source code. If you don't have it,
1.1       root      418: 
1.1.1.3   root      419: # you'll have to add/delete function prototypes by hand.
1.1       root      420: 
1.1.1.3   root      421: # also: Sozobon users will have to edit proto.h by hand to change the
1.1       root      422: 
1.1.1.3   root      423: #    #if defined(__STDC__) || defined(__cplusplus)
                    424: 
                    425: # line into
                    426: 
                    427: #    #if __STDC__
1.1       root      428: 
                    429: #
                    430: 
1.1.1.2   root      431: # This is more trouble than its worth, lets forget it for know (lets be
                    432: 
                    433: # honest editting proto.h by hand is usually easier...)
                    434: 
1.1.1.3   root      435: #
1.1.1.2   root      436: 
1.1.1.3   root      437: #proto.h: $(CSRCS)
1.1.1.2   root      438: 
1.1.1.3   root      439: #      mkptypes $(CSRCS) >proto.h
1.1.1.2   root      440: 
                    441: 
                    442: 
                    443: #
                    444: 
                    445: # macros for cleaning up
                    446: 
                    447: #
                    448: 
1.1.1.4 ! root      449: GENFILES= $(OBJS) $(OBJS030) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG) \
        !           450: 
        !           451:        $(YTABC) $(YTABH) magic.i __asm.o genmagic.o
1.1.1.2   root      452: 
1.1.1.4 ! root      453: EXTRAS= asmtab.c asmtab.h mint.prg mint030.prg mint.sym mint030.sym
1.1.1.2   root      454: 
                    455: 
                    456: 
                    457: clean:
                    458: 
1.1.1.3   root      459:        $(RM) -f $(GENFILES)
1.1.1.2   root      460: 
1.1       root      461: 
                    462: 
1.1.1.2   root      463: realclean:
1.1       root      464: 
1.1.1.3   root      465:        $(RM) -f $(GENFILES) $(EXTRAS)
1.1       root      466: 

unix.superglobalmegacorp.com

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