From: CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 22-DEC-1988 13:25 To: MRGATE::"ARISIA::EVERHART" Subj: Re: MAKE for VAX? Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue, 20 DEC 88 09:43:44 PDT Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue, 20 Dec 88 09:22:34 PST Received: by ucbvax.Berkeley.EDU (5.61/1.33) id AA25909; Tue, 20 Dec 88 07:09:52 PST Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 13 Dec 88 18:52:24 GMT From: unmvax!nmtsun!warner%hydrovax.nmt.edu@ucbvax.Berkeley.EDU (M. Warner Losh) Organization: New Mexico Tech Hydrology Program Subject: Re: MAKE for VAX? Message-Id: <1651@nmtsun.nmt.edu> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com In article <89*pettvi@pet.med.ubc.ca>, pettvi@pet.med.ubc.ca (Ed Grochowski) wants to know if anyone has seen the make distribution. I saw it and got it to compile (I'm on the USENET side of the world, so if INFO-VAX hasn't seen it, then maybe it's stuck in the mail queues...) I have been in contact with the poster, and he has asked me to post the documentation that I have for it. So, after my signature, please find a VMS SHARE file with MAKE.HLP (NOT a VMS help file, alas). The version of make that was posted (I think it was in five parts, but I could be wrong) was a modification of the make that appears on the Nelson Beebe (I hope I spelled your name right) TeX device driver tape. -- Warner Losh warner@hydrovax.nmt.edu ...!unmvax!nmtsun!warner%hydrovax What happened to our innocence, did it go out of style? My spelling and views are my own. Only the letters have been changed... $!.................... Cut between dotted lines and save. ..................... $!............................................................................. $! VAX/VMS archive file created by VMS_SHARE V06.03 20-Oct-1988. $! $! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from $! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au). $! $! To unpack, simply save, concatinate all parts into one file and $! execute (@) that file. $! $! This archive was created by user WARNER $! on 13-DEC-1988 11:51:55.92. $! $! It contains the following 1 file: $! MAKE.HLP $! $!============================================================================== $ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL ) $ VERSION = F$GETSYI( "VERSION" ) $ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK $ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", - "VMS_SHARE V06.03 20-Oct-1988 requires VMS V4.4 or higher." $ EXIT 44 $VERSION_OK: $ GOTO START $ $UNPACK_FILE: $ WRITE SYS$OUTPUT "Creating ''FILE_IS'" $ DEFINE/USER_MODE SYS$OUTPUT NL: $ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION - VMS_SHARE_DUMMY.DUMMY b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) ); s_file_spec := GET_INFO( COMMAND_LINE, "output_file" );SET( OUTPUT_FILE , b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" );i_errors := 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; pat_trail := " " & LINE_END;POSITION( BEGINNING_OF( b_part ) ); LOOP b := SEARCH( pat_trail, FORWARD); EXITIF b=0; POSITION( END_OF( b ) ) ; LOOP MOVE_HORIZONTAL( -1 ); EXITIF CURRENT_CHARACTER <> ' '; ERASE_CHARACTER ( 1 ); EXITIF CURRENT_OFFSET=0; ENDLOOP; ENDLOOP; POSITION( BEGINNING_OF ( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE ) = END_OF( b_part ) ; s_x := ERASE_CHARACTER( 1 ); IF s_x = "+" THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip < > 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF; IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip < > 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE ) ; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION ( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 ) ; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE ( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF; IF s_x = "V" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL ( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = "X" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL ( -CURRENT_OFFSET ); ENDIF; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> "" THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION ( b_errors ); COPY_TEXT( "The following line could not be unpacked properly:" ) ; SPLIT_LINE; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ) ; MOVE_VERTICAL( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ) ; ERASE_CHARACTER( 1 ); IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII ( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET ( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS" , i_errors, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" );ENDIF; EXIT; $ DELETE VMS_SHARE_DUMMY.DUMMY;* $ CHECKSUM 'FILE_IS $ WRITE SYS$OUTPUT " CHECKSUM ", - F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." ) $ RETURN $ $START: $ FILE_IS = "MAKE.HLP" $ CHECKSUM_IS = 57942248 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X MAKE X Implementation of Unix make Utility X for X TOPS-20 & VMS & MS-DOS & UNIX & EON & OS/9 X [18-Apr-87] X XMAKE is a version of a public-domain implementation of the XUnix make utility. A single source program supports Xversions for TOPS-20, VAX VMS, MS-DOS, UNIX, EON, and OS/9; Xthe choice between them is made at compile-time when MAKE is Xbuilt. It is compatible to a high degree with the original XUnix version, as far as the syntax of MAKEFILE's is Xconcerned. The built-in default rules have been modified to Xbe suitable for TOPS-20, VAX VMS, and MS-DOS, and a number Xof additional rules have been added. They are given below. X XThe essential ideas behind MAKE are: X X Many common tasks in software development are X repetitive (edit - compile - link - run and test), X and should be encapsulated in a command file to save X typing. X X Processing (e.g. compilation) of a single file is X unnecessary if that file, and its dependent files X (e.g. #include files) are older than the output X file(s) of the processing step. X X A computer program specially constructed for the X purpose (MAKE) can read a list of dependencies and X rules from a file, and from them, and from the file X last-write time stamps, determine what steps need to X be taken to bring everything up to date. X XComplete documentation on MAKE can be found in any Unix Xmanual on the corresponding man page (the file X/usr/man/man1/make on most Unix systems). The man page is Xavailable in INFO node (UNIXMAN)MAKE on UTAH-SCIENCE. An Xextended description is found in X X S.I. Feldman, "Make -- A Program for Maintaining X Computer Programs", pp. 291-300, Unix Programmer's X Manual, Volume 2, Holt, Rinehardt and Winston X (1983). X XThat article is in /usr/doc/make on most Unix systems, and Xis in INFO node MAKE on UTAH-SCIENCE. X XThe original version of MAKE was done by Stuart Feldman in X1978. This multi-operating-system version is based on a Xpublic-domain posting of 3-Dec-86 to the Usenet bulletin Xboard mod.sources, its author known only by an EMAIL Xaddress: Caret@FAIRLIGHT.OZ. It contained support for Unix, XOS9, and EON operating systems. The TOPS-20, VMS, and XMS-DOS support was added by Nelson H.F. Beebe X(BEEBE@UTAH-SCIENCE). X XSupport for VAX VMS libraries was borrowed from another Xpublic-domain VMS MAKE by Todd Aven. This permits a Xfilename in a MAKEFILE to be replaced by X"libname.xlb(modulename)". The library filename must Xinclude the file extension, since it cannot be inferred by Xcontext. Here is a simple example: X Xfoo.olb(bar):`009bar.obj X`009library foo.olb bar.obj X`009delete bar.obj X Xfee.exe:`009fee.obj foo.olb(bar) X`009link fee,foo/lib X XWith library targets, the macro $@ expands to the library Xname, and $% to the module name. Library support is still Xweak in that there is no way in the current MAKE syntax to Xspecify a default rule for installing a module into a Xlibrary, since the rule syntax assumes the files differ only Xin extension. X XUnder Unix, when MAKE determines that it needs to execute a Xshell command to update a target file, it issues a call to Xsystem() in the standard C library. The command is executed Xby a fresh copy of the shell, and it returns an exit code (0 Xon success, non-zero on error) to the shell which in turn Xreturns that code to MAKE. X XThe implementation of system() with the KCC compiler under XTOPS-20 differs somewhat, in that the shell (TOPS-20 EXEC) Xis fed its commands from the terminal input buffer, as if Xthey were typed by the user, exactly like the DO and MIC Xcommands and the batch job controller do, instead of getting Xthem from a file. This mechanism is necessary because the XEXEC has not been trained to exit gracefully at end-of-file Xin a top-level command file. The net effect is the same, Xwith the exception that it is possible for user type-ahead Xto be mixed in with the input MAKE is stuffing into the Xterminal input buffer; therefore, when running MAKE, keep Xyour fingers off the keys until it is done. X XIf you wish to have MAKE's commands executed in batch, the Xcommand list can be captured in a file, and not executed by XMAKE, as follows: X X make -n >foo.ctl X submit foo X XTOPS-20 commands do not return any command status code to Xtheir parent, so a TOPS-20 MAKE run may attempt to do more Xsteps than it would under Unix, since it normally assumes Xthat each step succeeds. X XThe touch (-t) option is not yet implemented in the TOPS-20 Xand VAX VMS versions of MAKE. X XUnlike Unix make, this MAKE has been built to be Xcase-insensitive, both for command-line switches, and for Xrules and file names in makefiles. A compile-time switch Xcan select case sensitivity if desired. X XIn order to support multi-line strings to be passed to Xsystem() (usually a program invocation and its input), XTOPS-20 MAKE provides for the substition of "\n" literals in Xrule lines by newlines prior to calling system. Here is an Xexample: X Xliblcl: fileof.rel jfnof.rel freass.rel system.rel getlog.rel X delete liblcl.rel X maklib\n\ X liblcl=freass,fileof/a,getlog/a,jfnof/a,system/a\n\ X liblcl=liblcl/index\n\ X `026 X copy liblcl.rel.0 c: X delete liblcl.rel X XNote that the MAKLIB invocation actually consists of 4 Xlines. The backslash on the first 3 is necessary to get the Xrule picked up as one string, and the "\n" sequences will be Xconverted to newlines by doexp() before the rule line (which Xis really 4 lines) is passed to system(). X XMAKE has fairly lax parsing rules, and the only characters Xthat are particulary significant are white space (token Xseparators), initial tab (on a rule line), colon and Xsemicolon following a target name, and equals in macro Xassignments. Nevertheless, these characters could Xconceivably be required in names, particularly colon in XTOPS-20, VMS, and MS-DOS filenames. Therefore, an extension Xto Unix make is adopted which permits a backslash to protect Xthe following character from special interpretation. The Xfollowing sequences are recognized: X X \n LF, newline X \t HT, horizontal tab X \b BS, backspace X \r CR, carriage return X \f FF, formfeed X \\ \, backslash X \' ', single quote X \ddd ddd, character corresponding to 1, 2, or 3 X octal digit bit pattern. X XAny other backslash-char pair is reduced to char; for Xexample, \= will be reduced to =, and \\ to \. X XHere is the complete list of built-in TOPS-20 MAKE macros, Xrules, and suffixes. It was produced by requesting MAKE to Xprint its built-in values by executing X X MAKE -p X Xin a PHOTO session, then editing the output PHOTO log. Note Xthat it includes rules for compiling source code in C, FAIL, XFORTRAN, MACRO, MIDAS, PASCAL, and SFTRAN3, and for Xprocessing various TeX files. All compiler and program Xnames used in built-in rules are defined by macros to Xfacilitate modifying MAKE's behavior. Finally, macros RM Xand MV are used for DELETE and RENAME, to facilitate porting XMAKEFILE's from TOPS-20 to Unix. X X $ = $ X AFLAGS = X AMSTEX = AMSTeX X AMSTEXFLAGS = \batchmode X AS = compile X CC = kcc X CFLAGS = X FC = compile X FFLAGS = /debug:(argument,label) X LATEX = LaTeX X LATEXFLAGS = \batchmode X MV = rename X PC = compile X PFLAGS = X RM = delete X SF3 = sf3 X SLITEX = SliTeX X SLITEXFLAGS = \batchmode X TEX = TeX X TEXFLAGS = \batchmode X YACC = yacc X X .atx.dvi: X - $(AMSTEX) $(AMSTEXFLAGS) \input $< X X X .amstex.dvi: X - $(AMSTEX) $(AMSTEXFLAGS) \input $< X X X .c.rel: X - $(CC) $(CFLAGS) -c $< X X X .fai.rel: X - $(AS) $(AFLAGS) $< X X X .mac.rel: X - $(AS) $(AFLAGS) $< X X X .mid.rel: X - $(AS) $(AFLAGS) $< X X X .for.rel: X - $(FC) /fortran/language:"$(FFLAGS)" $< X X X .f.rel: X - $(FC) /fortran/language:"$(FFLAGS)" $< X X X .ltx.dvi: X - $(LATEX) $(LATEXFLAGS) \input $< X X X .latex.dvi: X - $(LATEX) $(LATEXFLAGS) \input $< X X X .pas.rel: X - $(PC) /pascal/language:"$(PFLAGS)" $< X X X .p.rel: X - $(PC) /pascal/language:"$(PFLAGS)" $< X X X .sf3.for: X - $(SF3) $(SF3FLAGS) $< X X X .stx.dvi: X - $(SLITEX) $(SLITEXFLAGS) \input $< X X X .slitex.dvi: X - $(SLITEX) $(SLITEXFLAGS) \input $< X X X .tex.dvi: X - $(TEX) $(TEXFLAGS) \input $< X X X .y.c: X - $(YACC) $(YFLAGS) $< X - $(MV) ytab.c $@ X X X .y.rel: X - $(YACC) $(YFLAGS) $< X - $(CC) $(CFLAGS) -c ytab.c X - $(RM) ytab.c X - $(MV) ytab.rel $@ X X .SUFFIXES: .exe .rel .dvi .c .y .l .mac .fai .mid .sf3 .for .f \ X .pas .p .tex .latex .ltx .slitex .stx .amstex .atx \ X .inc .h $ GOSUB UNPACK_FILE $ EXIT