# CKUKER.MAK, Mon Nov 26 15:51:50 1990
#
CKVER= "5A(163) ALPHA"
#
# -- Makefile to build C-Kermit for UNIX and UNIX-like systems --
#
# Author: Frank da Cruz, Columbia University Center for Computing Activities
# 612 West 115th Street, New York, NY 10025, USA.  Phone (212) 854-5126.
# e-mail: fdc@watsun.cc.columbia.edu, fdc@columbia.edu, or FDCCU@CUVMA.BITNET.
#
#   C-Kermit can also be built for many other systems not supported by this
#   makefile, including the Apple Macintosh, the Commodore Amiga, OS-9, 
#   IBM OS/2, DEC VAX/VMS.  See the system-specific ck?ker.mak files.  Support 
#   was also added to C-Kermit for some other systems like Data General AOS/VS
#   and Apollo Aegis, but these versions may need a lot of work to bring them 
#   up to 5A level.
#
# WARNING: This is a pre-Beta test release.  Use at your own risk.
#
# Many of the implementations listed below are untested for v5A:
# + Those that have been tested successfully are marked with "+".
# - Those that are known not to work are marked with "-".
# x Those that build successfully but some features don't work, marked "x".
# ? Those as yet untested marked with "?".
#
# Those marked with + are not guaranteed to work.  The "+" means that C-Kermit
# 5A was built successfully and tested to some degree without showing obvious
# problems, but not necessarily in the current edit.  That is, something that
# has been done to the program in recent edits might have broken a previously
# working version.
#
# Please report successes or failures (preferably with fixes) to the author.
#
# INSTALLATION NOTES:
#
# Before proceeding, read the instructions below, and also read the file
# ckuker.bwr (the "beware file"), and then rename this file to "makefile"
# or "Makefile" if necessary, and then give the appropriate "make" command
# (see next section).  Further installation information is in the file
# ckuins.doc.
#
# 1. If you have received C-Kermit on MS-DOS format diskettes (such as those
# distributed by Columbia), you should make sure that your DOS-to-UNIX
# conversion utility both: (1) changes line terminators in all files from
# carriage-return linefeed (CRLF) to just linefeed (LF) and removes any
# Ctrl-Z's, and (2) that all filenames are converted from uppercase to
# lowercase.
#
# 2. Make sure that the blank space in front of each make entry is a real tab,
# not a bunch of spaces.  Otherwise the make command will not work correctly.
# Some networks and conversion utilities will change these tabs to spaces.
#
# 3. Some versions of Xenix and System V, and who knows what else, have
# available nap() and rdchk() system calls.  If your system has these, you
# should add -DNAP and -DRDCHK to the make entry for your system.  Kermit will
# work better if you do.  Please report entries where this change can be made.
# (But don't add -DNAP for NCR Tower 32.)
#
# 4. If your UNIX system has Honey DanBer UUCP, make sure the -DHDBUUCP
# compiler option is set in the makefile entry.  If your UNIX system
# does not have HDB UUCP but the makefile entry contains this option,
# remove it before giving the 'make' command.  If you don't know if your
# system has HDBUUCP, then check for the existence of /usr/lib/uucp/Systems.
#
# 5. Use caution if you intend to run Kermit setuid.  Read the section in
# ckuker.upd under edit 146 and in ckuins.doc.
#
# 6. If you get complaints about NPROC having an invalid value, add a valid
# definition for it, as in the cray entry.
#
# 7. If you get a lot of warnings about illegal pointer combinations, you might
# be able to make them go away by adding -DSIGTYP=int or -DSIGTYP=void to your
# makefile entry.
#
# 8. If you get a complaint at compile time about an illegal pointer-integer
# combination in ckufio.c involving popen(), or at link time that _popen is an
# undefined symbol, add the declaration "FILE *popen();" to the function
# zxcmd() in ckufio.c (this declaration is supposed to be in <stdio.h>).  If
# making this change does not help, then apparently your UNIX does not have
# the popen() function, so you should add -DNOPOPEN to your make entry, in
# which case certain functions involving "file" i/o to the standard input and
# output of subprocesses will not be available.
#
# 9. In some cases, the -O (optimize) compiler switch is omitted.  Feel free
# to add it if you trust your optimizer.  The ckuus2.c module, in particular,
# tends to make optimizers blow up.  Conversely, if your make option includes
# the -O switch and cc fails during compilation, try removing the -O switch,
# or compile the offending module by hand with the same options as in the
# makefile entry, but without -O.  Report results to the author.  
#
# 10. Other systems that are close to, but not quite, like Sys III or V, or
# 4.x BSD or V7 -- look at some of the tricks used below and see if you
# can find a combination that works for you.  In particular, notice the
# entry for the Silicon Graphics IRIS: a System V UNIX with a BSD file system!
#
# 11. Hints for reducing the size of the program:  (1) -DNOHELP compiles out
# the built-in help feature; (2) -DNOTLOG and -DNODEBUG compiles out the
# transaction and debugging log features.  Total savings from (1) and (2):
# about 24K.
#
# 12. For further information, see the file ckuins.doc (installation 
# documentation), ckaaaa.hlp (file naming conventions), ckuker.upd (program
# update history), ckuker.bwr ("beware" file).
#
# MAKE COMMANDS FOR DIFFERENT UNIX VERSIONS:
#
# Those marked with ? are untested in version 5A.  Please report results
# to the author.  Those marked with + are tested and believed to work.  Those
# marked with - believed not to work.  Those marked with x can be built and 
# run but some features (typically DIAL or HANGUP) might not work.
#
# + for Alliant FX/8 with Concentrix 4.1 or later, "make bsdlck"
# ? for Altos 986 with Xenix 3.0, "make altos"
# ? for Amdahl UTS 2.4 on IBM 370 series & compatible mainframes, "make uts24"
# + for Amdahl UTSV IBM 370 series & compatible mainframes, "make sys3"
# + for Amdahl mainframes with with UNIX System V R 5.2.6b 580, "make sys3"
# ? for Apollo DOMAIN/IX, "make bsd" or "make sys3", for desired environment
# ? for Apollo DOMAIN/IX, if the above fails, try "make apollobsd"
# + for Apollo with SR10.0 or later, BSD environment, "make sr10-bsd"
# + for Apollo with SR10.0 or later, System V environment, "make sr10-s5r3"
# ? for Apollo with straight Aegis using native Aegis i/o, "make aegis"
# + for Apple Macintosh II with A/UX, "make aux"
# + for AT&T 6300 PLUS, "make att6300" or (with no debugging) "make att6300nd"
# ? for AT&T 6386 Unix PC, "make sys5r3"
# + for AT&T 3B2, 3B20 systems, "make att3bx"
# + for AT&T 3B1, 7300 Unix PC, "make sys3upc"
# + for AT&T System III/System V R2 or earlier, "make sys3" or "make sys3nid"
# + for AT&T System III/System V with Honey DanBer UUCP, "make sys3hdb"
# + for AT&T System V R3, use "make sys5r3".  This is different from the above.
# ? for AT&T System V R4, "make sys5r3"
# + for AT&T System V on DEC VAX, "make sys3" or "make sys5r3"
# ? for BBN C/70 with IOS 2.0, "make c70"
# ? for Bell Unix Version 7 (aka 7th Edition), "make v7" (but see below)
# ? for Berkeley Unix 2.9 (DEC PDP-11 or Pro-3xx), "make bsd29"
# ? for Berkeley Unix 2.10, "make bsd210" or for overlays "make bsd210ov"
# + for Berkeley Unix 4.1, "make bsd41"
# + for Berkeley Unix 4.2, "make bsd" (tested with 4.2 and 4.3)
# + for Berkeley Unix 4.2 or 4.3 with HoneyDanBer UUCP, "make bsdhdb"
# + for Berkeley Unix 4.3, "make bsd43" (uses acucntrl program)
# + for Berkeley Unix 4.3 without acucntrl program, "make bsdlck" or "make bsd"
# ? for Berkeley Unix 4.3-Reno, same as 4.3 BSD.
# ? for Berkeley Unix 4.4, same as 4.3 BSD.
# ? for Cadmus, "make sys3"
# ? for Callan, "make sys3"
# ? for CDC VX/VE 5.2.1 Sys V emulation, "make vxve"
# ? for Charles River Data Systems 680x0 systems with Unos, "make sys3nid"
# ? for CIE Systems 680/20 with Regulus, "make cie"
# ? for Coherent OS on IBM PC family, "make coherent"
# + for Convex C1, "make convex"
# + for Cray X/MP or Y/MP with Unicos System V R3, "make cray"
# + for Cyber 910 (Silicon-Graphics Iris) with Irix 3.3, "make sys5r3"
# + for Data General Aviion, "make sys5r3" (maybe compile ckwart separately)
# ? for Data General MVxxxxx with DG/UX, ???
# + for DEC VAX (or DECstation?) with Ultrix 1.x, 2.x "make bsd"
# + for DEC VAX (or DECstation?) with Ultrix 3.0, 3.1, "make du3"
# + for DECstation (or VAX?) with Ultrix 4.0 "make du4"
# ? for DEC Pro-350 with Pro/Venix V1.x, "make provx1"
# ? for DEC Pro-350 with Pro/Venix V2.0 (Sys V), "make sys3nid" 
# ? for DEC Pro-380 with Pro/Venix V2.0 (Sys V), "make sys3" or "make sys3nid"
# ? for DEC Pro-380 with 2.9 or 2.10 BSD, "make bsd29" or "make bsd210"
# + for DIAB DS90 with DNIX (any version) create an empty <sys/file.h>
#     if this file does not already exist.  Then:
# + for DIAB DS90 with DNIX 5.2 (Sys V.2) or earlier, "make dnix"
# + for DIAB DS90 with DNIX 5.3 (Sys V.3), "make dnix5r3"
# + for Encore Multimax 310, 510 with UMAX 4.2, "make umax42"
# + for Encore Multimax 310, 510 with UMAX 4.3, "make umax43"
# + for Encore Multimax 310, 510 with UMAX V 2.2, use Berkeley cc, "make bsd"
# ? for Fortune 32:16, For:Pro 1.8, "make ft18"
# + for FPS 500 with FPX 4.1, "made bsd"
# ? for Heurikon, "make sys3"
#     Note: Maybe some of the following HP entries can be eliminated.
#     HP-UX users report infinite variations...
# + for HP-9000 Series, HP-UX pre-7.0, without long filenames, "make hpux"
# ? for HP-9000 Series, HP-UX 7.0 or later, no long filenames, "make hpux7sf"
# + for HP-9000 Series with HP-UX Sys V R2, BSD long names, "make hpuxlf"
# + for HP-9000 Series with HP-UX Sys V R2, dirent long names, "make hpuxde"
# + for HP-9000 Series with HP-UX Sys V R3, "make hpuxs5r3"
# ? for IBM 370 Series with IX/370, "make ix370"
# + for IBM 370 Series with AIX/370 3.0, "make aix370"
# ? for IBM PC family with Mark Williams Coherent OS, "make coherent"
# ? for IBM PC/AT family with MINIX, "make minix" (good luck).
# + for IBM PC/AT family with MINIX, new compiler, "make minixnew"
# + for IBM PC family, 386-based, with MINIX/386, "make minix386"
# + for IBM PS/2 with PS/2 AIX 1.0 or 1.1, "make ps2aix"
# + for IBM PS/2 with PS/2 AIX 3.0, "make aixps2"
# + for IBM RISC System/6000 with AIX 3.0, "make rs6000"
# ? for IBM RT PC with AIX 2.1, "make sys3"
# + for IBM RT PC with AIX 2.2.1, "make rtaix" (special lockfile handling)
# ? for IBM RT PC with ACIS 4.2, "make bsd"
# + for Intel 302 with Bell Tech Sys V/386 R3.2, "make sys5r3"
# ? for Intel Xenix/286, "make sco286"
# ? for Interactive System III (PC/IX) on PC/XT, "make pcix"
# ? for Interactive System III on other systems, "make is3"
# ? for Masscomp RTU AT&T System III, "make rtu"
# + for Masscomp/Concurrent with RTU 4.0 or later, BSD environment, "make 
#     rtubsd", "make rtubsd2", "make rtubsd3" (depending on where ndir.h 
#     is stored, see entries below).
# ? for Masscomp/Concurrent with RTU 4.0 or later, System V environment,
#     "make rtus5" (System V R2) or "make rtus5r3" (System V R3 or later).
# + for Microport SV/AT (System V R2), "make mpsysv"
# ? for Microsoft,IBM Xenix (/286, PC/AT, etc), "make xenix" or "make sco286"
# + for MIPS machine with AT&T System V R3.0, "make mips"
# ? for Motorola Four Phase, "make sys3" or "make sys3nid"
# ? for NCR Tower 1632, OS 1.02, "make tower1"
# + for NCR Tower 1632 with System V, "make sys3"
# + for NCR Tower 32, OS Release 1.xx.xx, "make tower32-1"
# + for NCR Tower 32, OS Release 2.xx.xx, "make tower32-2"
# + for NCR Tower 32, OS Releases based on Sys V R3, "make tower32"
# + for NCR Tower 32, OS Releases based on Sys V R3 with gcc "make tower32g"
# + for NeXT, "make next"
# + for PFU Compact Compact A Series SX/A TISP V10/E50 (Japan), "make sxae50"
# ? for Plexus, "make sys3"
# + for Pyramid, "make bsd"
# ? for Ridge 32 (ROS3.2), "make ridge32"
# ? for SCO Xenix 2.2.1 with development system 2.2 on 8086/8 "make sco86"
# + for SCO Xenix/286 2.2.1 with development system 2.2 on 80286, "make sco286"
#     NOTE: reportedly this makefile is too long for SCO Xenix/286 make, but it
#     works with "makeL", or if some of the other make entries are edited out.
# + for SCO Xenix/386 2.2.2, "make sco386"
# + for SCO Xenix/386 2.3.x, "make sco3r2"
# + for SCO UNIX/386 3.2.0, "make sco3r2"
# + for SCO Xenix/386 or UNIX/386 with Excelan TCP/IP, "make sco3r2net"
# + for Sequent Balance 8000 or B8 with DYNIX 3.0.xx, "make bsdlck"
# + for Sequent Symmetry S81 with DYNIX 3.0.xx, "make bsdlck"
# + for Silicon Graphics Iris System V Irix 3.2 or earlier, "make iris"
# + for Silicon Graphics Sys V R3 with Irix 3.3 or later, "make sys5r3"
# + for Solbourne 4/500 with OS/MP 4, "make sunos4"
# + for SONY NEWS with 4.3BSD, "make bsd43"
# ? for SUN with pre-4.0 SUNOS versions, "make bsd" (or appropriate variant)
# + for SUN with SUNOS 4.0, BSD environment, "make sunos4"
# + for SUN with SUNOS 4.0, BSD, with SunLink X.25, "make sunos4x25"
# + for SUN with SUNOS 4.0, AT&T Sys V R3 environment, "make sunos4s5"
# + for SUN with SUNOS 4.1, BSD environment, "make sunos41" 
# + for SUN with SUNOS 4.1, BSD, with SunLink X.25, "make sunos41x25"
# + for SUN with SUNOS 4.1, AT&T Sys V R3 environment, "make sunos41s5" 
# + for Tandy 16/6000 with Xenix 3.0, "make trs16"
# ? for Tektronix 4336 with UTek OS, "make bsd"
# ? for Unistar, "make sys3"
# ? for Valid Scaldstar, "make valid"
# ? for Whitechapel MG01 Genix 1.3, "make white"
# ? for Zilog ZEUS 3.21, "make zilog"
#
# The result should be a runnable program called "wermit" in the current 
# directory.  After satisfactory testing, you can rename wermit to "kermit" 
# and put it where users can find it.
#
# To remove intermediate and object files, "make clean".
# To run lint on the source files, "make lintsun", "make lintbsd",
# "make lints5", as appropriate.
#
##############################################################################
#
# NOTES FOR V7 AND 2.X BSD (BASED ON VERSION 4E OF C-KERMIT):
# (It is very likely that version 5A is too big for V7 or 2.x BSD.)
#
# For Unix Version 7, several variables must be defined to the values
# associated with your system.  BOOTNAME=/edition7 is the kernel image on
# okstate's Perkin-Elmer 3230.  Others will probably be /unix.  PROCNAME=proc
# is the name of the structure assigned to each process on okstate's system.
# This may be "_proc" or some other variation.  See <sys/proc.h> for more
# info on your systems name conventions.  NPROCNAME=nproc is the name of a
# kernel variable that tells how many "proc" structures there are.  Again
# this may be different on your system, but nproc will probably be somewhere.
# The variable NPTYPE is the type of the nproc variable -- int, short, etc.
# which can probably be gleaned from <sys/param.h>.  The definition of DIRECT
# is a little more complicated.  If nlist() returns, for "proc" only, the
# address of the array, then you should define DIRECT as it is below.  If
# however, nlist() returns the address of a pointer to the array, then you
# should give DIRECT a null definition (DIRECT= ).  The extern declaration in
# <sys/proc.h> should clarify this for you.  If it is "extern struct proc
# *proc", then you should NOT define DIRECT.  If it is "extern struct proc
# proc[]", then you should probably define DIRECT as it is below.  See
# ckuv7.hlp for further information.
#
# For 2.9 BSD, the makefile may use pcc rather than cc for compiles; that's
# what the CC and CC2 definitions are for (the current version of the
# makefile uses cc for both; this was tested in version 4E of C-Kermit and
# worked OK on the DEC Pro 380, but all bets are off for version 5A).  2.9
# support basically follows the 4.1 path.  Some 2.9 systems use "dir.h" for
# the directory header file, others will need to change this to "ndir.h".
# There are also newer entries for 2.10 BSD, which need testing and probably
# refinement, particularly a new entry that builds the program with overlays.
#
# The v7 and 2.9bsd versions assume I&D space on a PDP-11.  When building
# C-Kermit for v7 on a PDP-11, you should probably add the -i option to the
# link flags.  Without I&D space, overlays will be necessary (if available),
# or code segment mapping (a`la Pro/Venix if that's available).
#
##############################################################################
#
# V7-specific variables.
# These are set up for Perkin-Elmer 3230 V7 Unix:
# 
PROC=proc
DIRECT=
NPROC=nproc
NPTYPE=int
BOOTFILE=/edition7
#
# ( For old Tandy TRS-80 Model 16A or 6000 V7-based Xenix, use PROC=_proc,
#   DIRECT=-DDIRECT, NPROC=_Nproc, NPTYPE=short, BOOTFILE=/xenix )
#
###########################################################################
#
#  Compile and Link variables:
#
#  EXT is the extension (file type) for object files, normally o.
#  See MINIX entry for what to do if another filetype must be used.
#
EXT=o
LNKFLAGS=
SHAREDLIB=
CC= cc
CC2= cc
#
###########################################################################
#
# Dependencies Section:
#
make:
	@echo 'make what?  You must tell which system to make C-Kermit for.'
	@echo Examples:  make bsd, make sys3, make sunos4, etc.

wermit: ckcmai.$(EXT) ckucmd.$(EXT) ckuusr.$(EXT) ckuus2.$(EXT) ckuus3.$(EXT) \
		ckuus4.$(EXT) ckuus5.$(EXT) ckuusx.$(EXT) ckuusy.$(EXT) \
		ckcpro.$(EXT) ckcfns.$(EXT) ckcfn2.$(EXT) ckcfn3.$(EXT) \
		ckuxla.$(EXT) ckucon.$(EXT) ckutio.$(EXT) ckufio.$(EXT) \
		ckudia.$(EXT) ckuscr.$(EXT)
	$(CC2) $(LNKFLAGS) -o wermit ckcmai.$(EXT) ckutio.$(EXT) \
		ckufio.$(EXT) ckcfns.$(EXT) ckcfn2.$(EXT) ckcfn3.$(EXT) \
		ckuxla.$(EXT) ckcpro.$(EXT) ckucmd.$(EXT) ckuus2.$(EXT) \
		ckuus3.$(EXT) ckuus4.$(EXT) ckuus5.$(EXT) ckuusx.$(EXT) \
		ckuusy.$(EXT) ckuusr.$(EXT) ckucon.$(EXT) ckudia.$(EXT) \
		ckuscr.$(EXT)  $(LIBS)

# Here is an example of building Kermit with overlays for a small machine,
# Like a PDP-11 without separate I&D space.  This is only an example and
# probably needs to be adjusted.  This example comes from a submission by 
# Dennis Flaherty (dennisf@studsys.mu.edu) for 2.10 BSD on a PDP-11, but
# pertained to version 4F, which was a lot smaller.
#
ovwermit: ckcmai.$(EXT) ckucmd.$(EXT) ckuusr.$(EXT) ckuus2.$(EXT) \
	ckuus3.$(EXT) ckuus4.$(EXT) ckuus5.$(EXT) ckcpro.$(EXT) \
	ckcfns.$(EXT) ckcfn2.$(EXT) ckcfn3.$(EXT) ckuxla.$(EXT) \
	ckucon.$(EXT) ckutio.$(EXT) ckufio.$(EXT) ckudia.$(EXT) \
	ckuscr.$(EXT)
	$(CC2) $(LNKFLAGS) -o wermit /lib/crt0.$(EXT) ckcmai.$(EXT) \
		ckutio.$(EXT) ckufio.$(EXT) ckcfns.$(EXT) ckcfn2.$(EXT) \
		ckcfn3.$(EXT) \
		 -Z ckuxla.$(EXT) ckcpro.$(EXT) ckucmd.$(EXT) ckuus2.$(EXT) \
		 -Z ckuus3.$(EXT) ckuus4.$(EXT) ckuus5.$(EXT) ckuusr.$(EXT) \
		 -Z ckucon.$(EXT) ckudia.$(EXT) ckuscr.$(EXT)
		 -Y -lc $(LIBS)

# Dependencies for each module...

ckcmai.$(EXT): ckcmai.c ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcnet.h ckcfil.h

ckcpro.$(EXT): ckcpro.c ckcker.h ckcdeb.h ckcasc.h

ckcpro.c: ckcpro.w wart ckcdeb.h ckcasc.h ckcker.h
	./wart ckcpro.w ckcpro.c

ckcfns.$(EXT): ckcfns.c ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcfil.h

ckcfn2.$(EXT): ckcfn2.c ckcker.h ckcdeb.h ckcsym.h ckcasc.h

ckcfn3.$(EXT): ckcfn3.c ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcfil.h

ckuxla.$(EXT): ckuxla.c ckcker.h ckcdeb.h ckcxla.h ckuxla.h

ckuusr.$(EXT): ckuusr.c ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \
		ckcasc.h ckcnet.h

ckuus2.$(EXT): ckuus2.c ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \
		ckcasc.h

ckuus3.$(EXT): ckuus3.c ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \
		ckcasc.h ckcnet.h ckcfil.h

ckuus4.$(EXT): ckuus4.c ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \
		ckcasc.h ckcnet.h

ckuus5.$(EXT): ckuus5.c ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \
		ckcasc.h

ckuusx.$(EXT): ckuusx.c  ckcker.h ckuusr.h ckcdeb.h ckcasc.h

ckuusy.$(EXT): ckuusy.c  ckcker.h ckcfil.h ckcdeb.h ckcasc.h

ckucmd.$(EXT): ckucmd.c ckcasc.h ckucmd.h ckcdeb.h

ckufio.$(EXT): ckufio.c ckcdeb.h ckcfil.h ckuver.h

ckutio.$(EXT): ckutio.c ckcdeb.h ckcnet.h ckuver.h

ckucon.$(EXT): ckucon.c ckcker.h ckcdeb.h ckcasc.h ckcnet.h

wart: ckwart.$(EXT)
	$(CC) $(LNKFLAGS) -o wart ckwart.$(EXT)

ckwart.$(EXT): ckwart.c

ckudia.$(EXT): ckudia.c ckcker.h ckcdeb.h ckucmd.h ckcasc.h

ckuscr.$(EXT): ckuscr.c ckcker.h ckcdeb.h ckcasc.h

###########################################################################
#
# Make commands for specific systems:
#
#
#Apple Mac II, A/UX
aux:
	@echo Making C-Kermit $(CKVER) for Macintosh A/UX...
	make wermit "CFLAGS = -DAUX -DDYNAMIC -DNETCONN -i -O" \
		"LNKFLAGS = -i"

#Berkeley Unix 4.1
bsd41:
	@echo Making C-Kermit $(CKVER) for 4.1BSD...
	make wermit "CFLAGS= -DBSD41" "LIBS = -ljobs"

#Berkeley 4.2, 4.3, also Ultrix-32 1.x, 2.x, 3.x, many others
bsd:
	@echo Making C-Kermit $(CKVER) for 4.2BSD...
	make wermit "CFLAGS= -DBSD4 -DNETCONN"

#Berkeley 4.2, 4.3, minimum size
bsdm:
	@echo Making C-Kermit $(CKVER) for 4.2BSD...
	make wermit "CFLAGS= -O -DBSD4 -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS -DNOICP" \
	"LNKFLAGS = -s"

#Berkeley Unix with HoneyDanBer UUCP
bsdhdb:
	@echo Making C-Kermit $(CKVER) for 4.2BSD with HDB UUCP...
	make wermit "CFLAGS= -DHDBUUCP -DBSD4 -DNETCONN"

#Berkeley Unix 4.3 with acucntrl program
bsd43:
	@echo Making C-Kermit $(CKVER) for 4.3BSD with acucntrl...
	make wermit "CFLAGS= -DBSD43 -DACUCNTRL -DNETCONN -O"

#Berkeley Unix 4.2 or 4.3 with lock directory /usr/spool/uucp/LCK/LCK..ttyxx,
#but without acucntrl program
bsdlck:
	@echo Making C-Kermit $(CKVER) for 4.2BSD, /usr/spool/uucp/LCK/...
	make wermit "CFLAGS= -DLCKDIR -DBSD4 -DNETCONN"

#Mark Williams Coherent on IBM PC family.
#There is a 64K limit on program size, so most features are compiled out.
#Result should be a bare-bones command-line only version with no character set
#conversion.
coherent:
	@echo Making C-Kermit $(CKVER) for IBM PC family with Coherent OS...
	@echo TOTALLY UNTESTED!  May need additional compiler or linker flags.
	make wermit "CFLAGS = -DV7 -DCOHERENT -DDYNAMIC -DNOICP -DNOCSETS \
	-DNOHELP -DNODIAL -DNOSCRIPT -DNODEBUG -DNOTLOG"

#DEC Ultrix 3.1 (and probably also 3.0)
du3:
	@echo Making C-Kermit $(CKVER) for Ultrix 3.x...
	make wermit "CFLAGS= -DBSD4 -DNETCONN -DDIRENT -DSIGTYP=void \
	-DDYNAMIC -O" "LNKFLAGS = -s"

#Name changed from ds4 to du4, should work on VAXes as well as DECstations.
ds4:
	make du4

#DEC Ultrix 4.0 on DECstation, VAXstation, VAX, etc.
du4:
	@echo Making C-Kermit $(CKVER) for Ultrix 4.0
	make wermit "CFLAGS= -DBSD4 -DNETCONN -DSIGTYP=void -DDYNAMIC -O" \
	"LNKFLAGS = -s"

#Encore, UMAX 4.3 (BSD) but without acucntrl program.
encore:
	make umax43

#Encore, UMAX 4.3 (BSD) but without acucntrl program.
umax43:
	@echo Making C-Kermit $(CKVER) for Encore UMAX 4.3...
	make PARALLEL=4 wermit \
	"CFLAGS= -DBSD43 -DENCORE -DDYNAMIC -DNETCONN -O"

#Encore, UMAX 4.2 (BSD)
umax42:
	@echo Making C-Kermit $(CKVER) for Encore UMAX 4.3...
	make PARALLEL=4 wermit \
	"CFLAGS= -DBSD4 -DENCORE -DDYNAMIC -DNETCONN -O"

#Berkeley Unix 2.8, 2.9 for PDP-11s with I&D space, maybe also Ultrix-11???
#If you have trouble with this, try removing "-l ndir".  If you still have
#trouble, add "-DNODEBUG -DNOTLOG".  Or try defining CC and/or CC2 as "pcc"
#instead of "cc".
bsd29:
	@echo Making C-Kermit $(CKVER) for 2.8 or 2.9BSD.
	@echo Read the makefile if you have trouble with this...
	make wermit "CFLAGS= -DBSD29" \
		"LNKFLAGS= -i -lndir" "CC= cc " "CC2= cc"

#Berkeley Unix 2.10 (Stan Barber, sob@bcm.tmc.edu)
bsd210:
	@echo Making C-Kermit $(CKVER) for 2.10BSD.
	@echo Read the makefile if you have trouble with this...
	make wermit "CFLAGS= -DBSD29 -DLCKDIR" \
		"LNKFLAGS= -i " "CC= cc " "CC2= cc"

#Berkely Unix 2.10, using overlays, see ovwermit above.
bsd210ov:
	@echo Making C-Kermit $(CKVER) for 2.10BSD with overlays (untested)...
	make ovwermit "CFLAGS= -DBSD29 -DLCKDIR" \
		"LNKFLAGS= -i " "CC= cc " "CC2= cc"

#Convex C1 with Berkeley Unix
convex:
	@echo Making C-Kermit $(CKVER) for Convex C1 / BSD...
	make wermit "CFLAGS= -DBSD4 -Dmsleep=mnap"

#Cray X-MP or Y-MP UNICOS System V R3
cray:
	@echo 'Making C-Kermit $(CKVER) for Cray X/Y-MP UNICOS System V R3...'
	make wermit NPROC=1 "CFLAGS= -DSVR3 -DDIRENT -DHDBUUCP -i -O" \
	"LNKFLAGS = -i"

#NeXT
#Uses shared library to make executable program about 80K smaller.
#Remove "LIBS = -lsys_s" if this causes trouble.
next:
	@echo Making C-Kermit $(CKVER) for NeXT Mach 1.0...
	make wermit "CFLAGS= -DNEXT -DNETCONN -DDYNAMIC -DLCKDIR" \
	"LIBS = -lsys_s"

#POSIX
# (this isn't real...)
posix:
	@echo Making C-Kermit for POSIX...
	make wermit "CFLAGS= -DPOSIX -DNETCONN -DLCKDIR -DBSD4"

#IBM's AIX 3.0 on IBM 370 mainframe, tested on AIX F44 thru F50.
aix370:
	@echo Making C-Kermit for IBM System/370 AIX 3.0...
	make wermit "CFLAGS= -DAIX370 -DNETCONN -DLCKDIR -DDIRENT -DYNAMIC" \
	"LIBS = -lbsd"

#IBM's AIX 3.0 on IBM PS/2, tested on AIX F44 thru F50.
#This is exactly the same as AIX370 except for the version herald.
aixps2:
	@echo Making C-Kermit for IBM PS/2 AIX 3.0...
	make wermit "CFLAGS= -DAIXPS2 -DNETCONN -DLCKDIR -DDIRENT -DYNAMIC" \
	"LIBS = -lbsd"

#IBM AIX 3.0 for RISC System/6000.
rs6000:
	@echo Making C-Kermit for IBM AIX 3.0 or 3.1, RS/6000...
	make wermit \
	"CFLAGS= -DAIXRS -DNETCONN -DSVR3 -DDIRENT -DYNAMIC"

#SUN OS version 4.0, BSD environment, has saved original euid feature.
sunos4:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.0, BSD environment...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DDIRENT -DNETCONN -DSAVEDUID -DDYNAMIC"

#SUN OS version 4.0, BSD environment, has saved original euid feature.
# Like sunos4, but with SunLink X.25 support.
sunos4x25:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.0 with SunLink X.25...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DDIRENT -DNETCONN -DSAVEDUID -DDYNAMIC -DSUNX25"

#SUN OS version 4.1, BSD environment, has saved original euid feature.
#Uses Honey DanBer UUCP.  Requires presence of /usr/spool/locks directory.
# /var/spool/ should be a symbolic link to  /usr/spool/.
sunos41:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.1...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DHDBUUCP -DDIRENT -DNETCONN -DSAVEDUID -DDYNAMIC"

#SUN OS version 4.1, BSD environment, has saved original euid feature.
# Like sunos41, but with SunLink X.25 support.
sunos41x25:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.1 with SunLink X.25...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DHDBUUCP -DDIRENT -DNETCONN -DSAVEDUID \
	-DDYNAMIC -DSUNX25"

#SUN OS version 4.1, BSD environment, no character set translation.
# Otherwise just like sunos41.
sunos41ncs:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.1, no character sets...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DHDBUUCP -DDIRENT -DNETCONN -DSAVEDUID \
	-DDYNAMIC -DNOCSETS"

#SUN OS version 4.0 or later, BSD environment, minimum size...
sunos4m:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.x, minimum size...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DHDBUUCP -DDIRENT -DSAVEDUID -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS -DNOICP" \
	"LNKFLAGS = -s"

#SUN OS version 4.0 or later, BSD environment, minimum size w/command parser.
sunos4mi:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.x, minimum interactive...
	make wermit \
	"CFLAGS= -O -DSUNOS4 -DHDBUUCP -DDIRENT -DSAVEDUID -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS " \
	"LNKFLAGS = -s"

#SUN OS version 4.0 or later, BSD, no debugging, no transaction log.
sunos4nd:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.x, no debug or trans log...
	make wermit \
	"CFLAGS= -DSUNOS4 -DSAVEDUID -DNETCONN -DDYNAMIC -DDIRENT \
	-DNODEBUG -DNOTLOG"

#SUN OS version 4.0, System V R3 environment (-i option omitted).
sunos4s5:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.0, System V R3...
	@echo Ignore harmless complaints about redefinition of symbols...
	make wermit "CC= /usr/5bin/cc " \
	"CFLAGS = -DSVR3 -DDIRENT -DSUN4S5 -DYNAMIC -O"

#SUN OS version 4.1 or later, System V R3 environment (-i option omitted).
#Like sunos4s5, but SUNOS 4.1 has switched to HDB UUCP lockfile conventions.
sunos41s5:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.1 System V R3...
	@echo Ignore harmless complaints about redefinition of symbols...
	make wermit "CC= /usr/5bin/cc " \
	"CFLAGS = -DSVR3 -DDIRENT -DHDBUUCP -DSUN4S5 -DDYNAMIC -O"

#SUN OS version 4.0 or later, BSD environment, using gcc with lint-like options
sunos4g:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.x with gcc...
	make wermit "CC= gcc " \
		"CFLAGS= -W -Wunused -Wpointer-arith -Wcast-qual -pedantic \
                 -O -DSUNOS4 -DHDBUUCP -DDIRENT -DNETCONN -DSAVEDUID -DDYNAMIC"

#SUN OS version 4.0 or later, gcc, profiling with gprof, no debugging.
#To get profile, "make sunos4p" (on SUN), then "./wermit".  After running
#wermit, "gprof ./wermit | lpr" or whatever to get execution profile.
sunos4p:
	@echo Making C-Kermit $(CKVER) for SUNOS 4.x with profiling...
	make wermit "CC= gcc " \
	"CFLAGS= -DSUNOS4 -DNODEBUG -DSAVEDUID -DDIRENT -DNETCONN -DDYNAMIC \
	-pg" "LNKFLAGS = -pg"

#Apollo with Aegis, using native Aegis i/o, etc.
# NOTE: This is JUST A GUESS!  Maybe -DUXIII instead of -DBSD4?
aegis:
	@echo Making C-Kermit $(CKVER) for Apollo Aegis...
	make wermit "CFLAGS= -DNOFILEH -DBSD4"

#Apollo with Domain SR10.0 or later, BSD environment
#Reportedly, it might also help to add '-A,systype=bsd4.3' to CFLAGS.
#Reportedly, there is also a problem with getc & putc macros that can
#be handled by using '#ifdef apollo' somewhere to redefine them???
#On the other hand, other reports indicate that it works fine as-is.
sr10-bsd:
	@echo Making C-Kermit $(CKVER) for Apollo SR10.0 / BSD ...
	make wermit "CFLAGS= -DNOFILEH -DBSD4 -Uaegis"

#Apollo with Domain SR10.0 or later, System V R3 environment.
#Don't use the optimizer (-O), it causes problems at runtime.
sr10-s5r3:
	@echo Making C-Kermit $(CKVER) for Apollo SR10.0 / Sys V R3 ...
	make wermit "CFLAGS= -DNOFILEH -DSVR3 -Uaegis"

#Apollo Domain/IX (untested, try this if sr10-bsd doesn't work)
apollobsd:
	@echo Making C-Kermit $(CKVER) for Apollo Domain/IX...
	make wermit "CC= /bin/cc " "CC2= /bin/cc " \
	"CFLAGS= -DNOFILEH -DBSD4 -Uaegis"

#Version 7 Unix (see comments above)
v7:
	@echo Making C-Kermit $(CKVER) for UNIX Version 7.
	@echo Read the makefile if you have trouble with this...
	make wermit "CFLAGS=-DV7 -DPROCNAME=\\\"$(PROC)\\\" \
	-DBOOTNAME=\\\"$(BOOTFILE)\\\" -DNPROCNAME=\\\"$(NPROC)\\\" \
	-DNPTYPE=$(NPTYPE) $(DIRECT)"

#AT&T UNIX System V R3, signal() is void rather than int.
#Uses dirent.h and Honey DanBer uucp.
sys5r3:
	@echo 'Making C-Kermit $(CKVER) for AT&T UNIX System V R3 or later...'
	make wermit "CFLAGS = -DSVR3 -DDIRENT -DHDBUUCP -i -O" "LNKFLAGS = -i"

#Silicon Graphics System V R3 with BSD file system (IRIS)
iris:
	@echo Making C-Kermit $(CKVER) for Silicon Graphics IRIS...
	make wermit "CFLAGS = -O -DSVR3 -DLONGFN -I/usr/include/bsd" \
	"LIBS = -lbsd"

#In case they type "make sys5"...
sys5:
	make sys3

#Generic ATT System III or System V (with I&D space)
sys3:
	@echo 'Making C-Kermit $(CKVER) for AT&T UNIX System III'
	@echo 'or System V R2 or earlier...'
	make wermit "CFLAGS = -DUXIII -i -O" "LNKFLAGS = -i"

#Generic ATT System III or System V R2 or earlier, "no void":
#special entry to remove "Illegal pointer combination" warnings.
sys3nv:
	@echo 'Making C-Kermit $(CKVER) for AT&T UNIX System III'
	@echo 'or System V R2 or earlier...'
	make wermit "CFLAGS = -DUXIII -Dvoid=int -i -O" "LNKFLAGS = -i"

#Generic ATT System III or System V (no I&D space)
sys3nid:
	@echo 'Making C-Kermit $(CKVER) for AT&T UNIX System III'
	@echo 'or System V R2 or earlier, no I&D space...'
	make wermit "CFLAGS = -DUXIII -O" "LNKFLAGS ="

#AT&T 7300/Unix PC systems, sys3 but special handling for internal modem.
sys3upc:
	@echo 'Making C-Kermit $(CKVER) for AT&T 7300 UNIX PC...'
	make wermit "CFLAGS = -DATT7300 -O" "LNKFLAGS = -i"

#AT&T 6300 PLUS (warning, -O might make it run out of space).
#NOTE: Remove -DHDBUUCP if not using Honey DanBer UUCP.
att6300:
	@echo 'Making C-Kermit $(CKVER) for AT&T 6300 PLUS...'
	make wermit "CFLAGS = -DATT6300 -DHDBUUCP -Ml -i -O" \
	"LNKFLAGS = -i -Ml"

#AT&T 6300 PLUS with no debugging (about 70K smaller!  Can use -O here.)
att6300nd:
	@echo 'Making C-Kermit $(CKVER) for AT&T 6300 PLUS, no debugging...'
	make wermit "CFLAGS = -DATT6300 -DHDBUUCP -DNODEBUG -i -O -Ml" \
		"LNKFLAGS = -i -Ml"

#AT&T 3B2, 3B20-series computers running AT&T UNIX System V.
#This is just generic System V with Honey DanBer UUCP, so refer to sys3hdb.
att3bx:
	make sys3hdb

#Any System V R2 or earlier with Honey DanBer UUCP (same as above)
sys3hdb:
	@echo 'Making C-Kermit $(CKVER) for AT&T UNIX System III'
	@echo 'or System V R2 or earlier with Honey DanBer UUCP...'
	make wermit "CFLAGS = -DUXIII -DHDBUUCP -i -O" "LNKFLAGS = -i"

#In case they say "make sys5hdb" instead of "make sys3hdb"...
sys5hdb:
	make sys3hdb

#IBM PS/2 with AIX 1.0 (currently in field test as F10A)
#  Reports indicate that -O switch must be omitted.
#  It is also possible that "made bsd" will work (reports welcome).
#  One report recommended "make LIBS=-lbsd bsd" did the trick.
ps2aix:
	@echo 'Making C-Kermit $(CKVER) for IBM AIX 1.0 PS/2...'
	make wermit "CFLAGS = -DUXIII -i" "LNKFLAGS = -i"

#IBM PC-RT with AIX 2.2.1
#This has some special unique and strange lockfile stuff in it.
rtaix:
	@echo 'Making C-Kermit $(CKVER) for IBM RT PC, AIX 2.2.1...'
	make wermit "CFLAGS = -DUXIII -DRTAIX -DHDBUUCP -O -w" \
	"LNKFLAGS = -i"

#HP 9000 series 300, 500, 800, no long filenames.
#This is probably only good for HPUX versions earlier than 6.2.
hpux:
	@echo 'Making C-Kermit $(CKVER) for HP-9000 HP-UX, no long filenames.'
	make wermit "CFLAGS = -DHPUX -O" "LNKFLAGS ="

#HP-UX 7.0, no long filenames, no network support.
hpux7sf:
	@echo 'Making C-Kermit $(CKVER) for HP-9000 HP-UX, no long filenames.'
	make wermit "CFLAGS = -DHPUX -DSIGTYP=void -O" "LNKFLAGS ="

#HP 9000 series 300, 500, 800, long filenames (using BSD file system)
# (This one is probably necessary for the Series 300)
hpuxlf:
	@echo 'Making C-Kermit $(CKVER) for HP-9000 HP-UX, long filenames...'
	make wermit "CFLAGS = -DHPUX -DNDIR -DLONGFN -O" "LNKFLAGS ="

#HP 9000 series 300, 500, 800, long filenames (using <dirent.h>)
hpuxde:
	@echo 'Making C-Kermit $(CKVER) for HP-9000 HP-UX, long filenames...'
	make wermit "CFLAGS = -DHPUX -DDIRENT -DDYNAMIC -O" "LNKFLAGS ="

#HP 9000 series 300, 500, 800, long filenames, System V R3 or later
# (Does anybody know what is the earliest release of HP-UX based on SVR3?)
hpuxs5r3:
	@echo 'Making C-Kermit $(CKVER) for HP-9000 HP-UX, long filenames...'
	make wermit "CFLAGS = -DHPUX -DSVR3 -DDIRENT -DNETCONN -O" \
	"LNKFLAGS =" "LIBS=-lBSD"

#Regulus on CIE Systems 680/20
cie:
	@echo 'Making C-Kermit $(CKVER) for CIE Systems 680/20 Regulus...'
	make wermit "CFLAGS = -DUXIII -DNOFILEH -DCIE -O" "LNKFLAGS ="

#Microport SV/AT for IBM PC/AT 286 and clones, System V R2.
#You can put back the -O flag, but then you may need to compile several of
#modules by hand.
mpsysv:
	@echo 'Making C-Kermit $(CKVER) for Microport SV/AT 286...'
	make wermit "CFLAGS= -DUXIII -Ml" "LNKFLAGS = -Ml"

#Microsoft "Xenix/286" e.g. for IBM PC/AT
xenix:
	@echo 'Making C-Kermit $(CKVER) for Xenix/286'
	make wermit "CFLAGS= -DXENIX -DNOFILEH -Dunix -F 3000 -i" \
	"LNKFLAGS = -F 3000 -i"

#SCO Xenix/286 2.2.1, e.g. for IBM PC/AT, PS/2 Model 50, etc.
#Reportedly, this "make" can fail simply because of the size of this
#makefile.  If that happens, use "makeL", or edit out some of the
#other entries.
sco286:
	@echo 'Making C-Kermit $(CKVER) for SCO Xenix/286...'
	@echo 'If make fails, try using makeL.'
	make wermit \
	"CFLAGS= -s -O -LARGE -DXENIX -DNOFILEH -Dunix -DRDCHK -DNAP -F 3000 \
        -i -M2let32" \
	"LIBS = -lx" "LNKFLAGS = -s -O -LARGE -F 3000 -i -M2let32"

#SCO Xenix/286 2.2.1, e.g. for IBM PC/AT, PS/2 Model 50, etc.
#As above, but with HDBUUCP
sco286hdb:
	@echo 'Making C-Kermit $(CKVER) for SCO Xenix/286 with HDB UUCP...'
	@echo 'If make fails, try using makeL.'
	make wermit \
	"CFLAGS= -s -O -LARGE -DXENIX -DNOFILEH -Dunix -DRDCHK -DNAP \
	-DHDBUUCP -F 3000 -i -M2let32" \
	"LIBS = -lx" "LNKFLAGS = -s -O -LARGE -F 3000 -i -M2let32"

#SCO Xenix 2.2.1 for IBM PC, XT, PS2/30, or other 8088 or 8086 machine
#If this doesn't work, try some of the tricks from sco286.
sco86:
	@echo 'Making C-Kermit $(CKVER) for SCO Xenix/86...'
	make wermit \
	"CFLAGS= -DXENIX -DNOFILEH -Dunix -F 3000 -i -M0me" \
	"LNKFLAGS = -F 3000 -i -M0me" "LIBS = -lx"

#SCO Xenix/386 2.2.2
sco386:
	@echo 'Making C-Kermit $(CKVER) for SCO Xenix/386...'
	make wermit \
	"CFLAGS= -DXENIX -DNOFILEH -Dunix -DRDCHK -DNAP -Otcl -i -M3e" \
	"LNKFLAGS = -i" "LIBS = -lx"

#SCO UNIX/386 3.2.0 and SCO Xenix 2.3.x
sco3r2:
	@echo 'Making C-Kermit $(CKVER) for SCO UNIX/386...'
	@echo 'Warning: If make blows up, edit the makefile to join'
	@echo 'the following three continued lines into one line.'
	make wermit \
	"CFLAGS= -DXENIX -DNOFILEH -DHDBUUCP -DRDCHK -DNAP -Otcl -i -M3e" \
	"LNKFLAGS = -i" "LIBS = -lx"

#SCO UNIX/386 3.2.0 and SCO Xenix 2.3.x with Excelan TCP/IP support
sco3r2net:
	@echo 'Making C-Kermit $(CKVER) for SCO UNIX/386 / Excelan...'
	@echo 'Warning: If make blows up, edit the makefile to join'
	@echo 'the following three continued lines into one line.'
	make wermit \
	"CFLAGS= -I/usr/include/exos -DXENIX -DNOFILEH -DHDBUUCP -DRDCHK \
	-DNAP -DNETCONN -DEXCELAN -Otcl -i -M3e" \
	"LNKFLAGS = -i" "LIBS = -lx -lsocket"

#PC/IX, Interactive Corp System III for IBM PC/XT
pcix:
	@echo 'Making C-Kermit $(CKVER) for PC/IX...'
	make wermit \
	"CFLAGS= -DPCIX -DISIII -Dsdata=sdatax -O -i" "LNKFLAGS = -i"

#Interactive Corp System III port in general --
is3:
	@echo 'Making C-Kermit $(CKVER) for Interactive System III...'
	make wermit "CFLAGS = -DISIII -Ddata=datax -O -i" "LNKFLAGS = -i"

#Masscomp System III
rtu:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU System III...'
	make wermit "CFLAGS= -UFIONREAD -DUXIII -O" "LNKFLAGS =" "LIBS= -ljobs"

#Masscomp/Concurrent RTU 4.0 or later, Berkeley environment.
#Includes <ndir.h> = /usr/include/ndir.h
#Note "LIBS = lndir" might not be necessary because of "ucb make".
rtubsd:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU 4.1A...'
	ucb make wermit "CFLAGS= -DBSD4 -DRTU -DNDIR -DHDBUUCP -DNETCONN" \
	"LIBS = -lndir"
	
#Masscomp/Concurrent RTU 4.0 or later, same as above,
#Includes "usr/lib/ndir.h"
#Note "LIBS = -lndir" might not be necessary because of "ucb make".
rtubsd2:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU 4.1A...'
	ucb make wermit "CFLAGS= -DBSD4 -DRTU -DXNDIR -DHDBUUCP" \
	"LIBS = -lndir"

#Masscomp/Concurrent RTU 4.0 or later, same as above,
#Includes <sys/ndir.h>
#Note "LIBS = lndir" might not be necessary because of "ucb make".
rtubsd3:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU 4.x BSD...'
	ucb make wermit "CFLAGS= -DBSD4 -DRTU -DHDBUUCP" "LIBS = -lndir"

#Masscomp/Concurrent RTU 4.0 or later, System V R2, using <dirent.h>.
#If this gives problems, add back the -DRTU switch.
rtus5:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU 4.x BSD...'
	make wermit "CFLAGS= -DUXIII -DHDBUUCP -DDIRENT"

#Masscomp/Concurrent RTU 4.x, System V R3, using <dirent.h>.
#Use this one if rtus5 gives warnings about pointer type mismatches.
#If this gives problems, add back the -DRTU switch.
rtus5r3:
	@echo 'Making C-Kermit $(CKVER) for Masscomp RTU 4.x BSD...'
	make wermit "CFLAGS= -DSVR3 -DHDBUUCP -DDIRENT"

#DEC Pro-3xx with Pro/Venix V1.0 or V1.1
# Requires code-mapping on non-I&D-space 11/23 processor, plus some
# fiddling to get interrupt targets into resident code section.
# This almost certainly doesn't work any more, but there are almost certainly
# no more of these systems in existence.
provx1:
	@echo 'Making C-Kermit $(CKVER) for DEC Pro-3xx, Pro/Venix 1.x...'
	make wart "CFLAGS= -DPROVX1" "LNKFLAGS= "
	make wermit "CFLAGS = -DPROVX1 -DNOFILEH -md780" \
		"LNKFLAGS= -u _sleep -lc -md780"

#NCR Tower 1632, OS 1.02
tower1:
	@echo 'Making C-Kermit $(CKVER) for NCR Tower 1632, OS 1.02...'
	make wermit "CFLAGS= -DTOWER1"

#NCR Tower 32, OS Release 1.xx.xx
tower32-1:
	@echo 'Making C-Kermit $(CKVER) for NCR Tower 32 Rel 1 System V R2...'
	make wermit "CFLAGS = -DUXIII -DDYNAMIC -O" "LNKFLAGS = -n"

#NCR Tower 32, OS Release 2.xx.xx
tower32-2:
	@echo 'Making C-Kermit $(CKVER) for NCR Tower 32 Rel 2 System V R2...'
	make wermit "CFLAGS = -DUXIII -DHDBUUCP -DDYNAMIC -O2" "LNKFLAGS = -n"

#NCR Tower 32, OS Releases based on System V R3
tower32:
	@echo 'Making C-Kermit $(CKVER) for NCR Tower 32 System V R3...'
	make wermit \
	"CFLAGS = -DSVR3 -DDIRENT -DHDBUUCP -DDYNAMIC -DNOSYSIOCTLH -O1"

#NCR Tower 32, OS Releases based on System V R3
tower32:
	@echo 'Making C-Kermit $(CKVER) for NCR Tower 32 System V R3, gcc...'
	make wermit "CC = gcc" \
	"CFLAGS = -DSVR3 -DDIRENT -DHDBUUCP -DDYNAMIC -DNOSYSIOCTLH -O1 \
	-O -fstrength-reduce -fomit-frame-pointer"

#Fortune 32:16, For:Pro 1.8 (mostly like 4.1bsd)
ft18:
	@echo 'Making C-Kermit $(CKVER) for Fortune 32:16 For:Pro 1.8...'
	make wermit "CFLAGS= -DNODEBUG -DBSD4 -DFT18 -DNOFILEH"

#Valid Scaldstar
#Berkeleyish, but need to change some variable names.
valid:
	@echo 'Making C-Kermit $(CKVER) for Valid Scaldstar...'
	make wermit "CFLAGS= -DBSD4 -DNODEBUG -DNOTLOG -Dcc=ccx -DFREAD=1"

#IBM IX/370 on IBM 370 Series mainframes
#Mostly like sys3, but should buffer packets.
ix370:
	@echo 'Making C-Kermit $(CKVER) for IBM IX/370...'
	make wermit "CFLAGS = -DIX370 -DUXIII -i -O" \
	"LNKFLAGS = -i"

#Amdahl UTS 2.4 on IBM 370 series compatible mainframes.
#Mostly like V7, but can't do initrawq() buffer peeking.
uts24:
	@echo 'Making C-Kermit $(CKVER) for Amdahl UTS 2.4...'
	make wermit "CFLAGS=-DV7 -DPROCNAME=\\\"$(PROC)\\\" \
	-DUTS24 -DBOOTNAME=\\\"$(BOOTFILE)\\\" -DNPROCNAME=\\\"$(NPROC)\\\" \
	-DNPTYPE=$(NPTYPE) $(DIRECT)"

#BBN C/70 with IOS 2.0
#Mostly Berkeley-like, but with some ATTisms
c70:
	@echo 'Making C-Kermit $(CKVER) for BBN C/70 IOS 2.0...'
	make wermit "CFLAGS= -DBSD4 -DC70"

#Zilog ZEUS 3.21
zilog:
	@echo 'Making C-Kermit $(CKVER) for Zilog Zeus 3.21...'
	make wermit "CFLAGS = -DUXIII -DZILOG -DNODEBUG -i -O" \
	"LNKFLAGS = -i -lpw"

#Whitechapel MG-1 Genix 1.3
white:
	@echo 'Making C-Kermit $(CKVER) for Whitechapel MG-1 Genix 1.3...'
	@touch ckcpro.c
	make wermit "CFLAGS= -DBSD4 -Dzkself()=0"

#Pixel 1000
pixel:
	@echo 'Making C-Kermit $(CKVER) for Pixel 1000...'
	make wermit "CFLAGS= -DBSD4 -Dzkself()=0"

#CDC VX/VE 5.2.1
vxve:
	@echo 'Making C-Kermit $(CKVER) for CDC VX/VE 5.2.1...'
	make wermit "CFLAGS = -DUXIII -DVXVE -DNODEBUG -DNOTLOG -i -O" \
	"LNKFLAGS = -i"
 
#Tandy 16/6000 with Xenix 3.0
#Add -DNOxxx options to remove features if program won't load.
trs16:
	@echo 'Making C-Kermit $(CKVER) for Tandy 16/16000, Xenix 3.0...'
	make wermit "CFLAGS = -DUXIII -DTRS16 -O" \
	"LNKFLAGS = -n -s"

#DIAB DS90 with DNIX 5.2.  Sys V with nap() and rdchk().
# nd = no opendir(), readdir(), closedir(), etc.
# Some of the modules fail to compile with -O.
dnixnd:
	@echo 'Making C-Kermit $(CKVER) for DIAB DS90 with very old DNIX 5.2.'
	make wermit "CFLAGS = -DUXIII -DNAP -DRDCHK -DDYNAMIC"

#DIAB DS90 with DNIX 5.2.  Sys V with nap() and rdchk().
# This one has opendir(), readdir(), closedir(), etc.
# Some of the modules fail to compile with -O.
dnix:
	@echo 'Making C-Kermit $(CKVER) for DIAB DS90 with old DNIX 5.2...'
	make wermit "CFLAGS = -DUXIII -DNAP -DRDCHK -DDIRENT -DDYNAMIC"

#DIAB DS90 with DNIX 5.3 or later, with HDB UUCP, nap() and rdchk().
dnix5r3:
	@echo 'Making C-Kermit $(CKVER) for DIAB DS90 with DNIX 5.3...'
	@echo 'with Honey DanBer UUCP'
	make wermit \
	"CFLAGS = -DSVR3 -DHDBUUCP -DNAP -DRDCHK -DDIRENT -DDYNAMIC -O"

#Ridge 32 with ROS 3.2
ridge32:
	@echo 'Making C-Kermit $(CKVER) Ridge 32 ROS 3.2'
	make wermit \
	"CFLAGS = -DUXIII -DNOFILEH -DNODEBUG -DNOTLOG -i -O" "LNKFLAGS = -i"

#Altos 986 with Xenix 3.0
altos:
	@echo 'Making C-Kermit $(CKVER) for Altos 986 with Xenix 3.0...'
	make wermit \
	"CFLAGS= -DUXIII -DNODEBUG -DNOTLOG -Dvoid=int -DCHAR=char -i -O" \
	"LNKFLAGS= -i"

#MINIX - PC version with 64K+64K limit.
# Reportedly, the linker (asld) can run out of space while linking.  The only
# way around this is to make a copy of libc.a from which all modules that are
# not used by Kermit are removed.  If you have trouble compiling or running
# wart, uncomment the two commented (###) lines below.
minix:
	@echo 'Making C-Kermit $(CKVER) for MINIX, no command parser...
	@echo 'TOTALLY UNTESTED!'
###	touch wart
###	touch ckcpro.c
	make wermit EXT=s \
	"CFLAGS= -DV7 -DMINIX -i -D_MINIX -D_POSIX_SOURCE -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS -DNOICP" \
	"LNKFLAGS= -i -T"

#MINIX - PC version with 64K+64K limit, new (as yet unreleased) ACK 2.0 beta C 
#compiler, which outputs .o object files, rather than .s.  But 'make' still
#expects .s files, so must be patched to use .o.  Tested on Minix 1.5.10.
minixnew:
	@echo 'Making C-Kermit $(CKVER) for MINIX (new compiler),'
	@echo 'no command parser...  TOTALLY UNTESTED!'
	make wermit \
	"CFLAGS= -DV7 -DMINIX -i -D_MINIX -D_POSIX_SOURCE -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS -DNOICP" \
	"LNKFLAGS= -i -T"

#MINIX/386 (PC Minix modifed by Bruce Evans in Australia to use 386 addressing)
#Note: This might even work with -DNOICP and some of the other -DNOxxx flags
#removed -- needs testing.
minix386:
	@echo 'Making C-Kermit $(CKVER) for MINIX/386, no command parser...
	@echo 'TOTALLY UNTESTED!'
	make wermit EXT=s \
	"CFLAGS= -DV7 -DMINIX -D_POSIX_SOURCE -DDYNAMIC"

#MINSUN
# For testing MINIX compilation on SUN-4
# (it compiles, but it doesn't load at all...)
minsun:
	@echo 'Making C-Kermit $(CKVER) for MINIX, no command parser...
	@echo 'TOTALLY UNTESTED!'
	touch ckcpro.c	
	touch wart
	make wermit \
	"CFLAGS= -DV7 -DMINIX -i -D_MINIX -D_POSIX_SOURCE -DDYNAMIC \
	-DNODIAL -DNOHELP -DNODEBUG -DNOTLOG -DNOSCRIPT -DNOCSETS -DNOICP \
	-DSIGTYP=void -Du_long=long -Du_short=short -DS_IFMT=0170000 \
        -DS_IFDIR=0040000 -DS_IFREG=0100000" \
	"LNKFLAGS = -i -T"

#MIPS machine with AT&T UNIX System V R3.0
#Not sure if -DDIRENT is the right thing, give it a try and test wildcards
#and long file names.  If they don't work, read ckuins.doc.
mips:
	@echo 'Making C-Kermit $(CKVER) for MIPS AT&T System V R3.0...'
	make wermit "CFLAGS = -DMIPS -DDIRENT -i -O1500"

#PFU Compact A Series UNIX System V R3, SX/A TISP V10/L50 (Japan)
sxae50:
	@echo 'Making C-Kermit $(CKVER) for PFU SX/A V10/L50...'
	make wermit "CFLAGS= -DSVR3 -DDIRENT -DsxaE50 -i -O" "LNKFLAGS= "

#Clean up intermediate and object files
clean:
	@echo 'Removing object files...'
	-rm -f ckcmai.$(EXT) ckucmd.$(EXT) ckuusr.$(EXT) ckuus2.$(EXT) \
 ckuus3.$(EXT) ckuus4.$(EXT) ckuus5.$(EXT) ckcpro.$(EXT) ckcfns.$(EXT) \
 ckcfn2.$(EXT) ckcfn3.$(EXT) ckuxla.$(EXT) ckucon.$(EXT) ckutio.$(EXT) \
 ckufio.$(EXT) ckudia.$(EXT) ckuscr.$(EXT) ckwart.$(EXT) ckuusx.$(EXT) \
 ckuusy.$(EXT) ckcpro.c wart

#Run Lint on this mess for the SUN/BSD version.
lintsun:
	@echo 'Running Lint on C-Kermit $(CKVER) sources for SUNOS version...'
	lint -x -DSUNOS4 -DDIRENT -DNETCONN -DSAVEDUID -DDYNAMIC \
	ck[cu]*.c > ckuker.lint.sun

lintbsd:
	@echo 'Running Lint on C-Kermit $(CKVER) sources for BSD 4.2 version..'
	lint -x -DBSD4 -DNETCONN ck[cu]*.c > ckuker.lint.bsd42

lints5:
	@echo 'Running Lint on C-Kermit $(CKVER) sources for Sys V version...'
	lint -x -DUXIII ck[cu]*.c > ckuker.lint.s5
