# # Makefile for Unix-based TADS 2 ports. # Please add to this file, following the format, if you do new Unix ports. # # Compiling with GCC is strongly recommended. It may be difficult to # get stdargs (variable-length argument lists to functions) working # with other compilers. # # # Uncomment the definitions for your system and comment all the others. # Check to make sure you've got the right build line at the bottom as well. # If you are doing a new port, you will almost certainly have to edit # some of the source files (at least osunixt.h). In some cases, options # can be selected by passing options through the UNIXFLAGS variable. # For example, -DHAVE_STRCASECMP signifies that you have strcasecmp() in # your system instead of stricmp(). # # NOTE: Do NOT put optimization flags in the CFLAGS; put them in OPTIMIZE # instead. Some files can't be compiled with optimization on all systems # due to missing volatiles, compiler optimization bugs, and who knows # what else. # # Warning: The Tgetstr library routine does not seem to work quite right # under some version of SunOS. In particular, it can get confused by # a TERMCAP environment variable that contains more than one termcap # entry. Perhaps this is actually not incorrect behavior, but emacs # and vi both work in this case since they have their own (better) # Tgetstr equivalents. # # Build the targets tadsc.static and tadsr.static to get statically # compiled binaries on systems that default to dynamic linking. You # will only want to do this to support people on your Unix system with # outdated dynamic libraries. Generally it is not necessary to distribute # statically linked binaries. # # The debugger (tdb) port is currently very half-assed. To simulate # the page flipping of two 80x25 screens as in the DOS version, it # assumes an 80x50 screen and splits it into two halves. If the window # you run the debugger in is not exactly 80x50 it will not work properly. # # # Places to look for include files. # INCLUDES=-I. -I.. # # Current patchlevel of Unix sources. This applies to all # machines. Use -DSYSPATCHLEVEL=\"\" for single-machine # patches. # # Note that this is a *string*. # # Only change this if you've made a patch that applies to all # Unix ports. If you've fixed something in a specific port, # change SYSPL in the port's SYSFLAGS line. # UNIXPATCHLEVEL= -DUNIXPATCHLEVEL=\"1\" # # Names of various maintiners # Add your name here if you do a new Unix port. # DAVE="Dave Baggett " ADAM="Adam Thornton " # # IBM RT with GCC 2.1 # Has no stdlib.h, so you need to make one in the current directory # that includes stdio.h and sys/types.h # # This hasn't been tested since version 2.1, so you will almost # certainly have to upgrade it. # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX #SYSFLAGS= -DOS_SYSTEM_NAME=\""IBM_RT"\" -DSYSNAME=\""IBM RT"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DIBM_RT -I. #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # SGI running Irix with GCC # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX -DHAVE_STRCASECMP #SYSFLAGS= -DOS_SYSTEM_NAME=\""SGI_IRIX"\" -DSYSNAME=\""SGI running Irix"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DSGI_IRIX #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # SGI running Irix with CC: # #CC=cc -32 #OPTIMIZE=-O2 #UNIXFLAGS=-DOSANSI -DUNIX -DHAVE_STRCASECMP -DOS_MCM_NO_MACRO #SYSFLAGS= -DOS_SYSTEM_NAME=\""SGI_IRIX"\" -DSYSNAME=\""SGI running Irix"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DSGI_IRIX #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # SPARCstation (Solaris) with GCC 2.4.5 # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX #SYSFLAGS= -DOS_SYSTEM_NAME=\""SUN_SPARC_SOLARIS"\" -DSYSNAME=\""Sun Sparc running Solaris"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DSUN_SPARC_SOLARIS #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # SPARCstation running SunOS with GCC 2.4.5 # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX #SYSFLAGS= -DOS_SYSTEM_NAME=\""SUN_SPARC_SUNOS"\" -DSYSNAME=\""Sun Sparc running SunOS"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DSUN_SPARC_SUNOS #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # Sun 3 with GCC 2.3.2 # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX #SYSFLAGS= -DOS_SYSTEM_NAME=\""SUN_3"\" -DSYSNAME=\""Sun 3 running SunOS"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DSUN3 #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # NeXT (Cube or Station) with NeXTstep cc (which is a modified gcc) # (may work as well on a PC running NeXTstep) # #CC=cc #OPTIMIZE=-O #UNIXFLAGS=-v -g -DOSANSI -DUNIX -DHAVE_STRCASECMP #SYSFLAGS= -DOS_SYSTEM_NAME=\""NeXT"\" -DSYSNAME=\""NeXT"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(ADAM)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DNEXT #AFLAGS= #OVFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # # DECstation (MIPS) running Ultrix with GCC 2.3.3 # #CC=gcc #OPTIMIZE=-O2 #UNIXFLAGS=-v -g -DOSANSI -DUNIX -DHAVE_STRCASECMP #SYSFLAGS= -DOS_SYSTEM_NAME=\""DEC_MIPS_ULTRIX"\" -DSYSNAME=\""DECstation MIPS running Ultrix"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DULTRIX_MIPS #AFLAGS= #OVLFLG= #MACHDEP=osunixt.o #LIBS= -ltermcap #MAKEXEC=touch # Linux 386 with GCC 2.7.2 # CC=gcc OPTIMIZE=-O2 -funroll-loops -fomit-frame-pointer -m486 UNIXFLAGS=-g -DOSANSI -DUNIX -DHAVE_STRCASECMP SYSFLAGS= -DOS_SYSTEM_NAME=\""LINUX_386"\" -DSYSNAME=\""i386+ running Linux"\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"$(DAVE)\" CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DLINUX_386 AFLAGS= OVLFLG= MACHDEP=osunixt.o LIBS=-ltermcap MAKEXEC=touch # # i386+ running DOS/Windows, using DJGPP 2.X # # Be sure to use a recent port of GNU Make (>= 3.69) to get # around command line length limitations. # # # NOTE: You will need the GNUish versions of cp and rm to # use this makefile. You can get these from # # # # or # # # # Both cp and rm are in the fut312bx.zip archive. # # # NOTE: You have to build the compiler separately, with -DUSE_STDIO # specified on the SYSFLAGS line. Typically, you will build the # run-time and debugger with -DUSE_STDIO commented out, then remove # .o files and builds tadsc with -DUSE_STDIO on. # #CC=gcc #OPTIMIZE=-g -O2 -funroll-loops -fomit-frame-pointer -m486 #UNIXFLAGS=-DOSANSI -DUNIX -UMSDOS #SYSFLAGS= -DOS_SYSTEM_NAME=\"GO32\" -DSYSNAME=\"GO32\" -DSYSPL=\"1\" -DSYSMAINTAINER=\"dmb@ai.mit.edu\" # -DUSE_STDIO #CFLAGS= $(UNIXFLAGS) $(SYSFLAGS) -DDJGCC_386 #AFLAGS= #OVLFLG= #MACHDEP=biosvid.o osunixt.o #LIBS= #MAKEXEC=coff2exe # # Don't change stuff below this line unless you really know what you're doing. # # library object files LIBOBJS= ler.o # objects in common to all executables UNIXOBJS= COMMONOBJS= $(LIBOBJS) $(UNIXOBJS) mcm.o mcs.o mch.o obj.o cmd.o \ errmsg.o dummy.o fioxor.o os0.o oserr.o runstat.o \ fio.o getstr.o CMNRUNOBJS= $(COMMONOBJS) dat.o lst.o run.o out.o voc.o bif.o output.o suprun.o # objects for run-time RUNOBJS= vocab.o execmd.o ply.o qas.o TCAPOBJS= tputs.o tparm.o $(MACHDEP) # extra objects for character-mode run-time CHAROBJS= os0tr_un.o bifgdum.o osgen.o # objects for compiler (includes run-time objects) COMPOBJS= linf.o prs.o prscomp.o emt.o sup.o fiowrt.o tok.o objcomp.o \ osgen.o tokth.o dbg.o voccomp.o bifgdum.o TCOBJS= $(CMNRUNOBJS) $(COMPOBJS) tcgdum.o $(TCAPOBJS) os0tc_un.o tcd.o TPOBJS= $(CMNRUNOBJS) \ linf.o linm.o prs.o emt.o sup.o tok.o fio.o \ objcomp.o getstr.o $(MACHDEP) osgen.o tokth.o \ dbg.o voccomp.o bifgdum.o qas.o tpd.o vocab.o \ execmd.o dbgrun.o runstat.o ply.o TCGOBJS= $(COMPOBJS) tcg.o TROBJS= $(CMNRUNOBJS) $(RUNOBJS) linfdum.o $(CHAROBJS) $(TCAPOBJS) trd.o dbgtr.o # objects for debugger DBGOBJS= $(CMNRUNOBJS) $(COMPOBJS) $(RUNOBJS) tdd.o dbgu.o dbgrun.o TDBOBJS= $(DBGOBJS) $(TCAPOBJS) os0td_un.o all: tadsr tadsc tdb tadsr: $(TROBJS) $(CC) $(CFLAGS) $(TROBJS) -o tadsr $(LIBS) cp tadsr tadsr.notstripped strip tadsr $(MAKEXEC) tadsr tadsc: $(TCOBJS) $(CC) $(CFLAGS) $(TCOBJS) -o tadsc $(LIBS) cp tadsc tadsc.notstripped strip tadsc $(MAKEXEC) tadsc tdb: $(TDBOBJS) $(CC) $(CFLAGS) $(TDBOBJS) -o tdb $(LIBS) cp tdb tdb.notstripped strip tdb $(MAKEXEC) tdb tadsr.static: $(TROBJS) $(CC) $(CFLAGS) $(TROBJS) -static -o tadsr.static $(LIBS) strip tadsr.static tadsc.static: $(TCOBJS) $(CC) $(CFLAGS) $(TCOBJS) -static -o tadsc.static $(LIBS) strip tadsc.static tdb.static: $(TDBOBJS) $(CC) $(CFLAGS) $(TDBOBJS) -static -o tdb.static $(LIBS) strip tdb.static # # prscomp.c gets hosed by the optimizer on some machines, so we # build it without optimization. # # This GCC bug may have been fixed by now, but I wouldn't count on it, # since I don't remember how to test for it. :) # prscomp.o: prscomp.c $(CC) -c $(CFLAGS) $(UNIXPATCHLEVEL) $(INCLUDES) prscomp.c .c.o: $(CC) -c $(OPTIMIZE) $(UNIXPATCHLEVEL) $(CFLAGS) $(INCLUDES) $*.c # # Rules to copy files from general source directory # bif.c: ../bif.c cp ../bif.c bif.c bifgdum.c: ../bifgdum.c cp ../bifgdum.c bifgdum.c cmd.c: ../cmd.c cp ../cmd.c cmd.c dat.c: ../dat.c cp ../dat.c dat.c dbg.c: ../dbg.c cp ../dbg.c dbg.c dbgrun.c: ../dbgrun.c cp ../dbgrun.c dbgrun.c dbgtr.c: ../dbgtr.c cp ../dbgtr.c dbgtr.c dummy.c: ../dummy.c cp ../dummy.c dummy.c emt.c: ../emt.c cp ../emt.c emt.c err.c: ../err.c cp ../err.c err.c errmsg.c: ../errmsg.c cp ../errmsg.c errmsg.c execmd.c: ../execmd.c cp ../execmd.c execmd.c fio.c: ../fio.c cp ../fio.c fio.c fiowrt.c: ../fiowrt.c cp ../fiowrt.c fiowrt.c fioxor.c: ../fioxor.c cp ../fioxor.c fioxor.c getstr.c: ../getstr.c cp ../getstr.c getstr.c ler.c: ../ler.c cp ../ler.c ler.c linf.c: ../linf.c cp ../linf.c linf.c linfdum.c: ../linfdum.c cp ../linfdum.c linfdum.c lst.c: ../lst.c cp ../lst.c lst.c ltkwin.c: ../ltkwin.c cp ../ltkwin.c ltkwin.c mch.c: ../mch.c cp ../mch.c mch.c mcm.c: ../mcm.c cp ../mcm.c mcm.c mcs.c: ../mcs.c cp ../mcs.c mcs.c obj.c: ../obj.c cp ../obj.c obj.c objcomp.c: ../objcomp.c cp ../objcomp.c objcomp.c os0.c: ../os0.c cp ../os0.c os0.c oserr.c: ../oserr.c cp ../oserr.c oserr.c osgen.c: ../osgen.c cp ../osgen.c osgen.c out.c: ../out.c cp ../out.c out.c output.c: ../output.c cp ../output.c output.c ply.c: ../ply.c cp ../ply.c ply.c prs.c: ../prs.c cp ../prs.c prs.c prscomp.c: ../prscomp.c cp ../prscomp.c prscomp.c qas.c: ../qas.c cp ../qas.c qas.c run.c: ../run.c cp ../run.c run.c runstat.c: ../runstat.c cp ../runstat.c runstat.c sup.c: ../sup.c cp ../sup.c sup.c suprun.c: ../suprun.c cp ../suprun.c suprun.c tcd.c: ../tcd.c cp ../tcd.c tcd.c tcgdum.c: ../tcgdum.c cp ../tcgdum.c tcgdum.c tdd.c: ../tdd.c cp ../tdd.c tdd.c tok.c: ../tok.c cp ../tok.c tok.c tokth.c: ../tokth.c cp ../tokth.c tokth.c trd.c: ../trd.c cp ../trd.c trd.c voc.c: ../voc.c cp ../voc.c voc.c vocab.c: ../vocab.c cp ../vocab.c vocab.c voccomp.c: ../voccomp.c cp ../voccomp.c voccomp.c # # Clean up. # # In addition to removing .o's and binaries, this # also removes files copied from the general source directory. # clean: rm -f *.o rm -f tadsc tadsr tdb rm -f tadsc.static tadsr.static rm -f tadsc.notstripped tadsr.notstripped tdb.notstripped rm -f tadsc.exe tadsr.exe tdb.exe rm -f bif.c rm -f bifgdum.c rm -f cmd.c rm -f dat.c rm -f dbg.c rm -f dbgrun.c rm -f dbgtr.c rm -f dummy.c rm -f emt.c rm -f err.c rm -f errmsg.c rm -f execmd.c rm -f fio.c rm -f fiowrt.c rm -f fioxor.c rm -f getstr.c rm -f ler.c rm -f linf.c rm -f linfdum.c rm -f lst.c rm -f ltkwin.c rm -f mch.c rm -f mcm.c rm -f mcs.c rm -f obj.c rm -f objcomp.c rm -f os0.c rm -f oserr.c rm -f osgen.c rm -f out.c rm -f output.c rm -f ply.c rm -f prs.c rm -f prscomp.c rm -f qas.c rm -f run.c rm -f runstat.c rm -f sup.c rm -f suprun.c rm -f tcd.c rm -f tcgdum.c rm -f tdd.c rm -f tok.c rm -f tokth.c rm -f trd.c rm -f voc.c rm -f vocab.c rm -f voccomp.c