[net.sources] Make for VMS part 5 of 4

LARS@acc.ARPA (Lars Poulsen) (05/21/85)

$ Create 00PATCH.TXT
The follwing files are necessary replacements in order to
make Jon Corbett's VMS MAKE work. After unpacking the
previous four installments, unpack this one before 
submitting MAKEMAKE to SYS$BATCH.

Note that (at least under VMS_V3) MAKE will not run in a batch
will not run in a batch process.

One more patch is needed:
Turns out, VAX11C uses a non-standard format for picking
up #include files from SYS$LIBRARY:CSYSDEF.TLB. Thus, if
you want to be compatible, you should set up your header
#include's like this:
	#ifdef VAX11C
	#include stdio.h
	#else
	#include <stdio.h>
	#endif
The bracketed version will pick up files out in
SYS$LIBRARY itself; at our site, there are a set of files
out there belonging to Whitesmith's C, but certainly not
all the ones called out in the program were there, and
I don't think that Whitesmith's <stdio.h> is compatible
with DEC's runtime library.
			/ Lars Poulsen
			  Advanced Computer Communications
			 <Lars @ ACC.ARPA>


PS: I am slightly troubled by the use of an established name
    for an incompatible program (cf the discussion about the
    rights to the name 'rn' for a newsreader). We have a VMS
    and a UNIX system side by side, and we run EUNICE on our
    VMS system also. Thus we already have a "make" on our
    VMS system. Well, at least the 1MAKEFILE has a different
    file name.
$ Rename 1MAKEFILE. 1MAKEFILE.OLD
$ Create 1MAKEFILE.
!
! Makefile for make version 3.
!
# defclp
# define c_opts /nolist
# define for_opts /nolist
# define mar_opts /nolist
# define msg_opts /nolist
# define linkopts /nomap
# ifdef INSTALL
	# define linkopts ^linkopts /notrace
# endif
# define LIB	makelib.olb
# define MAKE$TIMER
# define MAKE$FILE_STATS
!
! Fancy constructions.
!
# cons .c (.olb)
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- cc ^c_opts ^MAKE$SOURCE
	- library ^LIB ^MAKE$SOURCE
	- delete ^MAKE$SOURCE.obj;*
# end
# cons .c .obj
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- cc ^c_opts ^MAKE$SOURCE
# end

# cons .for (.olb)
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- fortran ^for_opts ^MAKE$SOURCE
	- library ^LIB ^MAKE$SOURCE
	- delete ^MAKE$SOURCE.obj;*
# end
# cons .for .obj
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- fortran ^for_opts ^MAKE$SOURCE
# end

# cons .mar (.olb)
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- macro ^mar_opts ^MAKE$SOURCE
	- library ^LIB ^MAKE$SOURCE
	- delete ^MAKE$SOURCE.obj;*
# end
# cons .mar .obj
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- macro ^mar_opts ^MAKE$SOURCE
# end

# cons .msg (.olb)
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- message ^msg_opts ^MAKE$SOURCE
	- library ^LIB ^MAKE$SOURCE
	- delete ^MAKE$SOURCE.obj;*
# end
# cons .msg .obj
	# message ^MAKE$SOURCE\	[^MAKE$OUT_OF_DATE]
	- message ^msg_opts ^MAKE$SOURCE
# end

# cons x .olb
	# message Library is gone -- recreating
	- library /create ^$
	# wait
# end

!
! Now do it.
!
^LIB:

make.obj:		make
# debug findcons
^LIB(chdir):		make
^LIB(cons):		ltype
^LIB(ccons):
^LIB(charutl):
^LIB(checkdef):
^LIB(cpanic):
^LIB(comline):
^LIB(dcl):
^LIB(defclp):
^LIB(descr):
^LIB(dirty):
^LIB(docond):		fdate
^LIB(errmes):
^LIB(execute):
^LIB(fdate):		fdate	make
^LIB(file):		make
^LIB(filetype):
^LIB(findcons):		make
^LIB(ftlerrmsg):
^LIB(gettarget):
^LIB(iferr):
^LIB(lens):
^LIB(libtarget):
^LIB(linetype):		ltype
^LIB(log):
^LIB(mexit):
^LIB(myname):
^LIB(subproc):		make
^LIB(processl):		ltype
^LIB(quadmath):
^LIB(refsym):
^LIB(sctlc):
^LIB(search):		make
^LIB(setctlc):
^LIB(setdebug):
^LIB(setexh):
^LIB(sharp):		make
^LIB(shexec):
^LIB(shmake):		make	fdate
^LIB(shskip):
^LIB(skiptoels):	make
^LIB(sprintrmt):
^LIB(stab):
^LIB(timer):		make
^LIB(whoarewe):
!
! Do the link, if required.
!
# cons .obj .exe
	link ^linkopts make,^LIB/lib,sys$library:crtlib/lib
# end
# wait
make.exe:	^LIB(chdir)	^LIB(cons)	^LIB(ccons)	^LIB(charutl) \
		^LIB(comline)	^LIB(dcl)	^LIB(dirty)	^LIB(docond)  \
		^LIB(execute)	^LIB(fdate)	^LIB(file)	^LIB(filetype)\
		^LIB(findcons)	^LIB(gettarget)	^LIB(libtarget)	^LIB(linetype)\
		^LIB(iferr)\
		^LIB(mexit)	^LIB(processl)	^LIB(refsym)	^LIB(sharp)   \
		^LIB(skiptoels) ^LIB(stab)	^LIB(search)	^LIB(checkdef)\
		^LIB(timer)	^LIB(defclp)	^LIB(subproc)	^LIB(log)     \
		^LIB(whoarewe)
# dump file_stats

$ Create IFERR.C
iferr(status)
  int *status;
  {
    if (*status & 1)
      return;
    else
      {
    	printf("iferr: *status= %lx\n", *status);
	printf("iferr: fatal error - exiting\n");
        exit(status);
      }
  }
$ Create MAKEMAKE.TMP
X$
X$ ! This is MAKEMAKE.COM, which will put together the initial version of
X$ ! MAKE for you.
X$ Set default U:[lars.Xfer.Make]
X$ !
X$ ! Compile everything.
X$ !
X$ cc		CCONS.C
X$ cc		CHARUTL.C
X$ cc		CHDIR.C
X$ cc		CHECKDEF.C
X$ cc		COMLINE.C
X$ cc		CONS.C
X$ cc		CPANIC.C
X$ cc		DCL.C
X$ cc		DEFCLP.C
X$ cc		DESCR.C
X$ cc		DIRTY.C
X$ cc		DOCOND.C
X$ macro	ERRMES.MAR
X$ cc		EXECUTE.C
X$ cc		FDATE.C
X$ cc		FILE.C
X$ cc		FILETYPE.C
X$ cc		FINDCONS.C
X$ message	FTLERRMSG.MSG
X$ cc		GETTARGET.C
X$ cc iferr
X$ fortran	LENS.FOR
X$ cc libtarget
X$ cc		LINETYPE.C
X$ cc		LOG.C
X$ cc		MAKE.C
X$ cc		MEXIT.C
X$ fortran	MYNAME.FOR
X$ cc		PROCESSL.C
X$ macro	QUADMATH.MAR
X$ cc		REFSYM.C
X$ fortran	SCTLC.FOR
X$ cc		SEARCH.C
X$ macro	SETCTLC.MAR
X$ cc		SETDEBUG.C
X$ fortran	SETEXH.FOR
X$ cc		SHARP.C
X$ cc		SHEXEC.C
X$ cc		SHMAKE.C
X$ cc		SHSKIP.C
X$ cc		SKIPTOELS.C
X$ cc		SPRINTRMT.C
X$ cc		STAB.C
X$ cc		SUBPROC.C
X$ cc		TIMER.C
X$ cc		WHOAREWE.C
X$ !
X$ ! Now create the library and stuff everything into it.
X$ !
X$ library /create/object makelib *.obj
X$ delete *.obj;
X$ !
X$ ! Now link the goddam thing.
X$ !
X$ link /exe=make makelib/lib/incl=make, sys$library:crtlib/lib
$ EDIT MAKEMAKE.TMP/Output=MAKEMAKE.COM
S/X$/$/whole/notype
EXIT
$ EXIT
------

jon@boulder.UUCP (Jonathan Corbet) (05/24/85)

>One more patch is needed:
>Turns out, VAX11C uses a non-standard format for picking
>up #include files from SYS$LIBRARY:CSYSDEF.TLB. Thus, if
>you want to be compatible, you should set up your header
>#include's like this:
>	#ifdef VAX11C
>	#include stdio.h
>	#else
>	#include <stdio.h>
>	#endif
>The bracketed version will pick up files out in
>SYS$LIBRARY itself; at our site, there are a set of files
>out there belonging to Whitesmith's C, but certainly not
>all the ones called out in the program were there, and
>I don't think that Whitesmith's <stdio.h> is compatible
>with DEC's runtime library.

	It is true that VAX11C uses a weird format, but such use is entirely
optional, and I never use it.  All of my #included files are either distributed
with MAKE, or are provided with VAX11C.  No such patch is necessary.

	It has been remarked that the routine IFERR is missing.  Funny, I could
swear I generated the entire thing from the distribution copy before submitting
it, but I guess weird things happen.  Let me give you my version:




iferr (status)
int *status;
/*
 * Check the given VMS status value, and abort if an error is indicated.
 */
{
	if ((*status & 0x1) == 0)
		lib$signal (*status);
}



>PS: I am slightly troubled by the use of an established name
>    for an incompatible program (cf the discussion about the
>    rights to the name 'rn' for a newsreader). We have a VMS
>    and a UNIX system side by side, and we run EUNICE on our
>    VMS system also. Thus we already have a "make" on our
>    VMS system. Well, at least the 1MAKEFILE has a different
>    file name.

	I guess I see your point.  I just know that I needed a tool to give
me the same sort of functionality under VMS, so I wrote this thing for myself.
If you have spent any amount of time switching between systems, you know how
nice it is to be able to type the same thing in every place; thus I called it
make.  If you run EUNICE, just call MAKE something else...

	I am sorry to have distributed something that didn't work perfectly
the first time -- this is my first try at network software distribution.  If
you have any other troubles do let me know.

	However, do note that I will be at DECUS starting this weekend, and
I will not be back until june 6, so I won't be too responsive until then.

jon

-- 
Jonathan Corbet
National Center for Atmospheric Research, Field Observing Facility
{seismo|hplabs}!hao!boulder!jon		(Thanks to CU CS department)