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

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

unix.superglobalmegacorp.com

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