! MAKEFILE for VMS C-Kermit 5A (WERMIT) and labeled file decoder (CKVCVT) ! ! Original by Terry Kennedy (tmk), TERRY@SPCVXA.SPC.EDU, ! Saint Peters College, Jersey City, NJ, USA, ! 13-Apr-1991 ! ! To be used with the "make" program for VAX/VMS written by Todd Aven, the ! Software Sweatshop, 564 Laurelton Blvd, Long Beach, NY 11561, and upgraded ! to version 3.4 by Ned Freed. NOTE: Version 3.4 Required! ! ! Put this file in the same directory as the C-Kermit source files, make that ! directory your default directory, rename this file to "MAKEFILE." and then ! type "make" to build C-Kermit. The result will be a file, WERMIT.EXE, which ! you can run by typing "run wermit", and which you can rename to KERMIT.EXE ! or CKERMIT.EXE and install on your system according to the instructions in ! the file CKVINS.DOC. ! ! This makefile generates a DCL .COM file which will be shipped to many sites ! using many different combinations of software. Currently it supports 2 arch- ! itectures (VAX, AXP), 3 compilers (VAX C, DEC C/AXP, GCC) and 6 TCP/IP pack- ! ages (none, TGV, UCX, WIN, CMU, TCP) so it's considered to be *really* bad ! form to decide anything about the user's environment when the makefile is ! processed. All such choices should be done in the generated .COM file so that ! the user's actual environment can be used to make these decisions. ! ! Currently this is broken - the output .COM file will only work on the same ! architecture the make was done on. All of the __ALPHA tests being done in ! the makefile parse phase need to be deferred to DCL execution phase. The ! appropriate test is: ! alpha = 0 ! if f$getsyi("hw_model") .ge. 1024 then alpha = 1 ! if alpha then ... ! but I don't have an Alpha to verify this on, so I didn't change the makefile. ! ! Another big deficiency: this makefile does not allow for DEC C on a VAX. ! It assumes DEC C for Alpha, VAX C for VAX. This needs fixing. ! ! Cast of characters: ! ! tmk = Terry Kennedy, Saint Peters College, Jersey City, NJ ! fdc = Frank da Cruz, Columbia University, New York City ! jrs = James Sturdevant, CAP GEMINI AMERICA, Minneapolis, MN ! ttj = Tarjei T. Jensen, Norwegian Hydrographic Service ! mvb = Mark Berryman, Science Applications Int'l. Corp., San Diego, CA ! mlo = Mike O'Malley, Digital Equipment Corporation ! ! Revision history: ! ! 13-Apr-1991 - tmk - Original version ! 21-Jun-1991 - tmk - Make sure executables are properly accessible ! 05-Nov-1991 - fdc - Add ckuus7.c source module ! 19-Jun-1992 - jrs - Add WIN/TCP support ! 29-Jun-1992 - fdc - Add CURSES (SMG) support ! 02-Jul-1992 - jrs - Fix WIN/TCP support ! 04-Jul-1992 - tmk - Don't need VAXCCURSE library any more. ! 12-Jul-1992 - tmk - Add localopts. ! 23-Aug-1992 - fdc - Add KANJI support. ! 13-Oct-1992 - jrs - Add changes from Lee Tibbert for Alpha AXP and DEC TCP/IP ! 13-Oct-1992 - fdc - Add ckvioc.[ch] to DEC TCP/IP build ! 07-Dec-1992 - fdc - Remove /list compiler switch ! 26-May-1993 - jrs - Add GCC and TCPware support ! 20-Jul-1993 - ttj - Make sure GCC is used when selected. NOTES: ! 1. Because this makefile calls itself, it now MUST ! be called "MAKEFILE.". ! 2. As of this edit, Version 3.4 of MAKE/VMS is required. ! 19-Aug-1993 - jrs - Minor cleanups to previous edit ! 31-Aug-1993 - mvb - Clean up VMS AXP code and allow AXP version to also ! build with network support ! 07-Oct-1993 - mlo - Add CMU_TCPIP support ! 28-Nov-1993 - mlo - Use logical name and default location to locate ! LIBCMU object library ! 14-MAR-1994 - mlo - Replaced all references to "wermit.olb" with "$(K_LIB)" ! 15-MAR-1994 - mlo - added MAKE_CLEAN to modify siteopts on compiles ! 20-Jun-1994 - tmk - Added comments to generated .COM file, test for DEC ! fortran V6 and use old libraries if present. ! 24-Aug-1994 - fdc - Fixed compilersub to avoid prefixing of sockets ! routines on non-UCX Alpha AXP TCP/IP builds, suggested ! by Steve Smail of Wollongong. ! 24-Jul-1995 - fdc - Added ckusig.c and .h, 5A(191)-Alpha.015. ! 30-Jul-1995 - fdc - Renamed ckusig.h to ckcsig.h. ! 19-Sep-1996 - fdc - Add ckcnet.h to dependency for ckudia.c. ! ! Read CKVINS.DOC for instructions. ! ! SITE DEPENDENCIES - ! ! Some site options you might want to add: ! NOPUSH - Disallow access to DCL from within Kermit. ! NODEBUG - Remove all debugging code to make C-Kermit smaller and faster. ! ! The following site options are used in this file as distributed: ! DYNAMIC - Allocate packet and other buffers dynamically. ! NOJC - Omit Job-Control related code. ! NOSETBUF - Don't make console i/o unbuffered. ! CK_CURSES - Include fullscreen file transfer display. ! KANJI - Include Kanji file transfer translation. ! IFDEBUG - Avoid calls to debug() if debugging not on: faster execution ! but bigger .EXE file. If you don't need debugging at all, ! replace this by NODEBUG. ! %IFNDEF MAKE MAKE=make %ENDIF %IFNDEF PROGRAM PROGRAM=wermit %ENDIF %IFNDEF CC CC=cc %ENDIF %IFNDEF K_LIB K_LIB=wermit.olb %ENDIF %IFNDEF K_SYSLIB %IFNDEF __ALPHA K_SYSLIB=sys$share:vaxcrtl.olb/lib !K_SYSLIB=sys$share:vaxcrtl/share %ELSE K_SYSLIB= %ENDIF %ENDIF %IFNDEF GCC_FLAGS GCC_FLAGS= %ENDIF %IFNDEF CFLAGS %IFNDEF __ALPHA CFLAGS=/debug/noopt $(GCC_FLAGS) %ELSE CFLAGS=/nolist/debug /optimize=level=4 /standard=vaxc $(GCC_FLAGS) %ENDIF %ENDIF %IFNDEF LNFLAGS %IFNDEF __ALPHA LNFLAGS=/nomap %ELSE LNFLAGS=/nodebug %ENDIF %ENDIF $(K_LIB)(*): *.c call do_cc $* germit.olb(*): *.c call do_cc $* %IFDEF MAKE_CLEAN siteopts = /define=("DYNAMIC", "NOJC", "NOSETBUF", "CK_CURSES", \ "NODEBUG", "''net_option'", "''vms_ver'") %ELSE siteopts = /define=("DYNAMIC", "NOJC", "NOSETBUF", "CK_CURSES", "KANJI", \ "IFDEBUG", "''net_option'", "''vms_ver'") %ENDIF ! ! Compiler and linker options ! !link_switches = /map/full/sym link_switches = $(LNFLAGS) library_switches = /replace ckcnet_switches = "/prefix=ansi" ! unconditional_relink = makefile. ! ! Uncomment the next line to force unconditional relinking ! ! unconditional_relink = dummy_target ! ! Define the master target list - these can be rebuilt on any system that ! has C. ! all : wermit \ ckvcvt gcc_com: $(MAKE)/force/noexecute/keep/output=gcc_kermit.com \ /macro=("K_LIB=germit.olb", "CC=gcc", "PROGRAM=gkermit", - "K_SYSLIB=gnu_cc:[000000]gcclib/lib,sys$share:vaxcrtl.olb/lib",- "CFLAGS=/nolist/optimze=4") wermit ! gkermit: $(MAKE)/macro=("K_LIB=germit.olb", "CC=gcc", "PROGRAM=gkermit", - "K_SYSLIB=gnu_cc:[000000]gcclib/lib,sys$share:vaxcrtl.olb/lib",- "CFLAGS=/nolist/optimze=4") wermit ! wermit : checking \ wermit_start \ $(PROGRAM).exe write sys$output "Done rebuilding $(PROGRAM)" ! ckvcvt : checking \ ckvcvt_start \ ckvcvt.exe write sys$output "Done rebuilding CKVCVT" ! ! And here are the individual targets ! checking: header vms_version fort_check networking vaxc_check compilersub header: ! This is a really screwey way to do this - but MAKE won't put comments in ! the output, so we'll do it the hard way... goto skipit type sys$input $ $ $ WARNING: This is an automatically generated file - do *NOT* make changes $ here and expect them to survive into the next C-Kermit release. The only $ supported method is to edit the parent makefile (CKVKER.MAK) and rebuild $ this file with "MAKE/KEEP/NOEXECUTE/OUT=CKVKER.COM". $ $ $ $ skipit: vms_version: xxalpha = f$getsyi("cpu") .gt. 127 sys_ver = f$edit(f$getsyi("version"),"compress") if f$extract(0,1,sys_ver) .nes. "V" then type sys$input You appear to be running a Field Test version of VMS. This script will $ assume that the operating system version is at least V5.0. $ $ sys_ver = "V5.0" endif sys_maj = 0+f$extract(1,1,sys_ver) sys_min = 0+f$extract(3,1,sys_ver) %IFNDEF __ALPHA if sys_maj .lt. 5 then if (sys_min/2)*2 .ne. sys_min then \ sys_min = sys_min - 1 if sys_maj .lt. 5 then write sys$output "You are running VMS V''sys_ver'." type sys$input VMS C-Kermit has not been verified to build properly under this version, $ although pre-built versions will run properly. Please exercise caution $ until you have verified proper operation. $ $ endif %ENDIF vms_ver = "VMS_V''sys_maj'''sys_min'" fort_check: funky_fortran = 0 if f$search("SYS$SHARE:FORTRAN$MTHRTL-VMS.EXE") .nes. "" then type sys$input You have DEC Fortran V6.0 or later installed. We will link C-Kermit with $ the older, pre-Fortran V6 libraries so that it will run on systems which $ don't have Fortran V6 installed. (C-Kermit does not use any features of $ the new libraries). $ $ define mthrtl fortran$mthrtl-vms define vmthrtl fortran$vmthrtl-vms funky_fortran = 1 endif networking: if ("''net_option'" .eqs. "") then net_option = "NONET" library_dir = "SYS$LIBRARY" if f$search(f$parse(f$trnlnm("LIBCMU"),\ "CMUIP_ROOT:[SYSLIB]LIBCMU.OLB")) .nes. "" then net_option = "CMU_TCPIP" endif if f$search("SYS$LIBRARY:UCX$ACCESS_SHR.EXE") .nes. "" then net_option = "DEC_TCPIP" ckcnet_switches = "" endif if f$search("TCPWARE:UCX$IPC.OLB") .nes. "" then net_option = "TCPWARE" ckcnet_switches = "" library_dir = "TCPWARE" endif if f$search("TWG$COMMON:[NETDIST.LIB]TWGLIB.OLB") .nes. "" then net_option = "WINTCP" define /nolog vaxc$include twg$tcp:[netdist.include],sys$library define /nolog sys twg$tcp:[netdist.include.sys] endif if f$search("multinet:multinet_socket_library.exe") .nes. "" then \ net_option = "MULTINET" else library_dir = "SYS$LIBRARY" net_option = f$edit(net_option,"UPCASE") endif !net_option if net_option .eqs. "NONET" then net_name = "no" if net_option .eqs. "MULTINET" then net_name = "MultiNet" if net_option .eqs. "WINTCP" then net_name = "WIN/TCP" if net_option .eqs. "CMU_TCPIP" then net_name = "CMU-OpenVMS/IP" libcmu = f$search(f$parse(f$trnlnm("LIBCMU"),\ "CMUIP_ROOT:[SYSLIB]LIBCMU.OLB")) endif if net_option .eqs. "DEC_TCPIP" then \ net_name = "DEC TCP/IP Services for OpenVMS(tm)" if net_option .eqs. "TCPWARE" then net_name = "Process Software TCPware" net_option = "DEC_TCPIP" endif vaxc_check: if f$search("sys$library:xabrudef.h") .eqs. "" .and. - f$search("sys$library:sys$starlet_c.tlb") .eqs. "" then type sys$input Your system has an older version of the C compiler. VMS C-Kermit was $ designed to be compiled under VAX C V3.1 or newer or DEC C V1.3 or $ newer. It has not been verified to build properly under this version, $ although pre-built versions will run properly. Please exercise caution $ until you have verified proper operation. $ $ endif compilersub: DO_CC: Subroutine On Control_Y Then $exit %x10000004 On Warning Then $exit $status write sys$output " $(CC) Compiling ''P1' at ''f$time()" if xxalpha then if net_option .eqs. "MULTINET" .or. net_option .eqs. "WINTCP" then $(CC) $(CFLAGS) $(siteopts)/obj='P1'.obj 'localopts' 'P2' 'P1'.c - /PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES, EXCEPT=( - accept, bind, connect, listen, select, shutdown, socket, - recv, send, recvfrom, recvmsg, sendto, sendmsg, readv, - writev, gethostname, sethostname, getpeername, getsockname, - getsockopt, setsockopt, getnetbyname, getnetent, - setnetent, endnetent, getprotobyname, getprotobynumber, - getprotoent, setprotoent, endprotoent, getservbyname, - getservbyport, getservent, setservent, endservent, - gethostbyname, gethostbyaddr, gethostent, sethostent, - endhostent, inet_addr, inet_lnaof, inet_makeaddr, inet_netof, - inet_ntoa, inet_network, htonl, htons, ntohl, ntohs ) ) else $(CC) $(CFLAGS) $(siteopts)/obj='P1'.obj 'localopts' 'P2' 'P1'.c endif else $(CC) $(CFLAGS) $(siteopts)/obj='P1'.obj 'localopts' 'P2' 'P1'.c endif library $(library_switches) $(K_LIB) 'P1'.obj delete/NoLog 'P1'.obj.* exit EndSubroutine !DO_CC ! wermit_start : $(K_LIB) write sys$output "Rebuilding $(PROGRAM) with ''net_name' network support" if f$type(localopts) .eqs. "" then localopts = "" ! ckvcvt_start : write sys$output "Rebuilding CKVCVT" ! dummy_target : write sys$output "" ! $(K_LIB) : if f$search("$(K_LIB)") .eqs. "" ! creating the library then library/create/object $(K_LIB) write sys$output "$(K_LIB) created" endif ! germit.olb : if f$search("germit.olb") .eqs. "" ! creating the library then library/create/object germit.olb write sys$output "GERMIT.OLB created" endif ! $(PROGRAM).exe : $(K_LIB)(ckvioc) $(K_LIB)(ckcfn2) \ $(K_LIB)(ckcfn3) $(K_LIB)(ckcfns) $(K_LIB)(ckcmai) \ $(K_LIB)(ckcpro) $(K_LIB)(ckucmd) $(K_LIB)(ckudia) \ $(K_LIB)(ckuscr) $(K_LIB)(ckuus2) $(K_LIB)(ckuus3) \ $(K_LIB)(ckuus4) $(K_LIB)(ckuus5) $(K_LIB)(ckuus6) \ $(K_LIB)(ckuus7) $(K_LIB)(ckuusr) $(K_LIB)(ckuusx) \ $(K_LIB)(ckuusy) $(K_LIB)(ckcnet) $(K_LIB)(ckvfio) \ $(K_LIB)(ckvtio) $(K_LIB)(ckuxla) $(K_LIB)(ckvcon) \ $(K_LIB)(ckusig) \ $(unconditional_relink) write sys$output " Linking $(PROGRAM) at ''f$time()" if funky_fortran then write sys$output \ " Please ignore the following %LINK-I-IDMISMCH error" $ if net_option .eqs. "MULTINET" then link $(link_switches) /exec=$(PROGRAM).exe \ $(K_LIB)/library/include=ckcmai, sys$input:/options $(K_SYSLIB) $ multinet:multinet_socket_library.exe/share $ else if net_option .eqs. "WINTCP" then link $(link_switches) /exec=$(PROGRAM).exe \ $(K_LIB)/library/include=(ckcfn2, ckcfn3, ckcfns, \ ckcmai, ckcpro, ckucmd, ckudia, ckuscr, ckuus2, ckuus3, ckuus4, ckuus5, \ ckuus6, ckuus7, ckuusr, ckuxla, ckvcon, ckcnet, ckvfio, ckvtio, ckusig), \ twg$common:[netdist.lib]twglib.olb/library, \ sys$input:/options $(K_SYSLIB) $ else if net_option .eqs. "CMU_TCPIP" then link $(link_switches) /exec=$(PROGRAM).exe \ $(K_LIB)/library/include=(ckcfn2, ckcfn3, ckcfns, \ ckcmai, ckcpro, ckucmd, ckudia, ckuscr, ckuus2, ckuus3, ckuus4, ckuus5, \ ckuus6, ckuus7, ckuusr, ckuxla, ckvcon, ckcnet, ckvfio, ckvtio, ckusig), \ 'libcmu'/library, \ sys$input:/options $(K_SYSLIB) $ else if net_option .eqs. "DEC_TCPIP" then ! No symbol table -lt. 1992-08-14 link $(link_switches) /exec=$(PROGRAM).exe \ $(K_LIB)/library/include=(ckcfn2, ckcfn3, ckcfns, \ ckcmai, ckcpro, ckucmd, ckudia, ckuscr, ckuus2, ckuus3, ckuus4, ckuus5, \ ckuus6, ckuus7, ckuusr, ckuxla, ckvcon, ckcnet, ckvfio, ckvtio, ckvioc, \ ckusig), \ 'library_dir':ucx$ipc.olb/library, \ sys$input:/options $(K_SYSLIB) $ else link $(link_switches) /exec=$(PROGRAM).exe \ $(K_LIB)/library/include=(ckcfn2, ckcfn3, ckcfns, \ ckcmai, ckcpro, ckucmd, ckudia, ckuscr, ckuus2, ckuus3, ckuus4, ckuus5, \ ckuus6, ckuus7, ckuusr, ckuxla, ckvcon, ckcnet, ckvfio, ckvtio, ckusig), \ sys$input:/options $(K_SYSLIB) $ endif !DEC TCP or none endif !CMU-OpenVMS/IP endif !WIN/TCP endif !MultiNet set file/protection=(g:re,w:re) $(PROGRAM).exe ! ! ! First, make sure we have a current CKWART ! ckwart.exe : ckwart.c write sys$output " $(CC) Compiling CKWART at ''f$time()" $(CC) /nolist $(CFLAGS)$(siteopts)/obj=ckwart.obj 'localopts' ckwart.c write sys$output " Linking CKWART at ''f$time()" if funky_fortran then write sys$output \ " Please ignore the following %LINK-I-IDMISMCH error" $ link /nomap $(link_switches)/exec=ckwart ckwart.obj, sys$input:/opt $(K_SYSLIB) $ purge/nolog ckwart.obj ! ! Next, see if CKCPRO.C is current ! ckcpro.c : ckcpro.w \ ckwart.exe ckcdeb.h ckcasc.h ckcker.h write sys$output "Running CKWART at ''f$time()" ckwart = "$" +f$parse("CKWART.EXE",,,"DEVICE") + \ f$parse("CKWART.EXE",,,"DIRECTORY") + "CKWART" ckwart ckcpro.w ckcpro.c purge ckcpro.c $(K_LIB)(ckvioc) : ckvioc.c ckvioc.h ckcdeb.h $(K_LIB)(ckcfn2) : ckcfn2.c \ ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcxla.h ckuxla.h $(K_LIB)(ckcfn3) : ckcfn3.c \ ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcxla.h ckuxla.h $(K_LIB)(ckcfns) : ckcfns.c \ ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcxla.h ckuxla.h $(K_LIB)(ckcmai) : ckcmai.c \ ckcker.h ckcdeb.h ckcsym.h ckcasc.h ckcnet.h ckcsig.h $(K_LIB)(ckcpro) : ckcpro.c \ ckcker.h ckcdeb.h ckcasc.h $(K_LIB)(ckucmd) : ckucmd.c \ ckcasc.h ckucmd.h ckcdeb.h $(K_LIB)(ckudia) : ckudia.c \ ckcker.h ckcdeb.h ckucmd.h ckcasc.h ckcsig.h ckcnet.h $(K_LIB)(ckuscr) : ckuscr.c \ ckcker.h ckcdeb.h ckcasc.h ckcsig.h $(K_LIB)(ckuus2) : ckuus2.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \ ckcasc.h $(K_LIB)(ckuus3) : ckuus3.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \ ckcasc.h ckcnet.h $(K_LIB)(ckuus4) : ckuus4.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \ ckcasc.h ckcnet.h $(K_LIB)(ckuus5) : ckuus5.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcasc.h $(K_LIB)(ckuus6) : ckuus6.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcasc.h $(K_LIB)(ckuus7) : ckuus7.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \ ckcasc.h ckcnet.h $(K_LIB)(ckuusr) : ckuusr.c \ ckucmd.h ckcker.h ckuusr.h ckcdeb.h ckcxla.h ckuxla.h \ ckcasc.h ckcnet.h $(K_LIB)(ckuusx) : ckuusx.c \ ckcker.h ckuusr.h ckcdeb.h ckcasc.h $(K_LIB)(ckuusy) : ckuusy.c \ ckcker.h ckcdeb.h ckcasc.h $(K_LIB)(ckuxla) : ckuxla.c \ ckcker.h ckcdeb.h ckcxla.h ckuxla.h $(K_LIB)(ckvcon) : ckvcon.c \ ckcdeb.h ckcasc.h ckcker.h ckcnet.h ckvvms.h ckcxla.h $(K_LIB)(ckcnet) : ckcnet.c \ ckcdeb.h ckcker.h ckcnet.h %IFDEF __ALPHA call do_cc ckcnet "''ckcnet_switches'" %ENDIF $(K_LIB)(ckvfio) : ckvfio.c \ ckcdeb.h ckcasc.h ckcker.h ckvvms.h $(K_LIB)(ckvtio) : ckvtio.c \ ckcdeb.h ckcasc.h ckcker.h ckvvms.h $(K_LIB)(ckusig) : ckusig.c \ ckcdeb.h ckcasc.h ckcker.h ckcnet.h ckuusr.h ckcsig.h ckvcvt.exe : ckvcvt.c write sys$output " Compiling CKVCVT at ''f$time()" $(CC) $(CFLAGS)$(siteopts)/obj=ckvcvt.obj 'localopts' ckvcvt.c write sys$output " Linking CKVCVT at ''f$time()" if funky_fortran then write sys$output \ " Please ignore the following %LINK-I-IDMISMCH error" $ link /nomap $(link_switches)/exec=ckvcvt ckvcvt.obj, sys$input:/opt $(K_SYSLIB) $ set file/protection=(g:re,w:re) ckvcvt.exe purge ckvcvt.obj ! ! All done... !