COMPILE (Help file: 20240212) by Stan Sieler (about 1188 lines of help text follows) COMPILE intelligently compiles & preps programs. It can handle the following languages: SPL, SPLash!, FORTRAN, Pascal, MODCAL, COBOL, RPG, and C. (Sorry...no BASIC or BusinessBasic yet.) For the benefit of users who are seeing this help text as a result of typing "?" from the COMPILE program, the list of commands is next. After the command list is a set of "directives" that can be used when running COMPILE without an INFO string. That discussion is followed with an explanation of what COMPILE is and how it works. To exit COMPILE, type either // or EXIT. To compile a program called "EXIT" (a poor name for a program), type: EXIT.group From inside the COMPILE program, the syntax for compiling a program is: sourcefilename[.group] [option1 option2 option3 ... ] The various options may appear in any order and may be abbreviated to only the part shown in uppercase. Options are keywords (e.g., INFO), some of which have UNIX-style abbreviations, shown below: -A filename synonym for: ASMFILE filename -E filename synonym for: EXECUTABLE filename -I "..." synonym for: INFO "..." -L filename synonym for: LISTING filename -O programname synonym for: OBJECT programname -R filename synonym for: RL filename -S filename synonym for: SOURCE filename -U uslname (###) synonym for: USL uslname +U uslname (###) (see USL option, this differs from -U!) The various options (in alphabetic order) are: ABORT ASM ASM specifies that the language is Assembler. Note: ASM implies NM, because no CM assembler exists. ASMFILE name (or: -A name) Tells COMPILE to use "name" as the name for the SPLash! assembler file. Note: this option implies SAVEASM, unless NOSAVEASM has been specified earlier. ASMOUT # When the assembler is being used to assemble the output of the SPLash! compiler, the default size of the output file (NMOBJ) is 5,000 records. ASMOUT allows this value to be changed. [no]ASSEMBLE NOASSEMBLE tells COMPILE to skip the assembler phase of a SPLash! compilation. AUTOPURGEList If set, tells COMPILE that a "LISTING" or "-L" option should automatically purge any existing listing file (when sent to disk). AUXOBJ filename Specifies an NMOBJ (or NMRL) file to be used at link time. AUXUSL filename (segmentname [, segmentname2 ...] ) Requests COMPILE to direct the segmenter to open the auxiliary USL file 'filename' and copy the specified segments from it into $OLDPASS before doing a PREP. This is a shorthand method of doing: SEGMENTER: AUXUSL filename SEGMENTER: COPY SEGMENT, segmentname ... [no]BATch Tells COMPILE to schedule the compilation as a batch job. If BATCH is in the source file, it may be overridden by specifying INTeractive or NOBATCH on the command line. [no]BIG BIG does an implied PASXDATA to 400 C Specifies that the language is C (from CCSC) or C/XL. For CM compiles, the C used is CCSC. For NM compiles, the C used is C/XL. CANSI Sets "language" to ANSI C, which will include "-Aa" in any info string sent to the C compiler. [no]CAPs = capabilitylist (or: CAP=ALL) Valid capabilities are: BA, DS, IA, MR, PH, PM. If neither BA nor IA are specified, both are imposed. ALL is equivalent to BA, DS, IA, MR, PH, PM. Multiple [no]CAPs are allowed. For example: CAP=ALL NOCAP=BA CCSC Specifies that the languge is CCSC/C. (Only tested for the CM CCSC/C compiler.) [no]CHECKSUM CHECKSUM passes the ";CHECKSUM" flag to the CM PREP command. This will cause the segmenter to generate a checksum for every segment, and one for the entire program. Note that MPE does not ever check that the checksum is valid. [no]CIVAR [no]CM Use a Compatibility Mode compiler (e.g. Pascal/3000, not Pascal/XL). CM is the default when running on Classic HP3000s, and NM is the default on HP-PA HP3000s. COBol or COBOLII Specifies that the languge is COBOLII (for CM compiles) or COBOL/XL for NM compiles. If you want the old CM COBOL, then say COBOL1. COBOL1 or COBOLI Specifes that the language is the old CM COBOL compiler. COBOL1 implies CM. COBOL74 Specifes that the language is COBOL74. COBOL85 Specifes that the language is COBOL85. COMMENT Caused COMPILE to ignore the rest of the command line. COMPILE Overrides a NOCOMPILE command. If you have a file that you normally don't want to be compiled by an automatic recompilation process (e.g., one that passes every file in @.SOURCE to the COMPILE program), you can include a NOCOMPILE on the first line of that file. However, at some point you may decide that you DO want to compile it. Then, simply use the COMPILE keyword on the command line, which will override the NOCOMPILE. Of course, COMPILE is the default setting. NOCOMPILE is usually found only within a source file. Unless it is overridden by a COMPILE command, NOCOMPILE will cause COMPILE to skip the compilation of this file. COMPILEG COMPILEG tells COMPILE that it is allowed to process further "global" configuration files. On by default, unless disabled via COMPILEJCW or PARM (both documented in sections below this). NOCOMPILEG tells COMPILE to not look for further "global" configuration files. (See "Globals" section below) COMPILER filename Use the specified file as the compiler. E.g.: compiler newspl.pub.sieler CPRIority = CS / DS / ES Tells COMPILE what queue your compile should run in. Currently, this only affects BATCH compiles. The default value is DS. CRUNCH Tells COMPILE to "crunch" the final NMOBJ or OCT'ed CM PROG file. Default: CRUNCH for NM and OCT, NOCRUNCH for all else. Note: using CRUNCH and BATCH together requires the existance of a "CRUNCH" UDC that works like: CRUNCH filename CY Enables control-Y checking in COMPILE. Normally enabled for all compiles, except SPLash! language compiles (SPLash! has its own control-Y routine). DEBUG Starts your selected compiler with the DEBUG option. DLsize # Specifies a DL to prep the file with. If not specified, the system default is used. [no]DONTCOMPile DUMPWORTHY Sets the DUMPWORTHY flag at link time (only for NM compilations). ECHO restofline The ECHO command causes COMPILE to echo the rest of the input line to $stdlist. EXEcutable programname (or: -E programname) Tells COMPILE to compile and prep the source file into a program file called: programname. Note: if MODULE is true (or deduced because the name of the source file is xxx.MODULE or xxx.C), then programname is used as the name of the USL file that is generated by COMPILE. The -O form is for the UNIX hacks among us! ("O" stands for "O"bject or "O"utput.) FORTRAN Specifies that the language is FORTRAN. When CM is used, this results in the original HP FORTRAN compiler (FORTRAN/V). If you want FORTRAN 77, use the FTN77 option. When NM is used, then both FTN77 and FORTRAN result in the use of the FORTRAN/XL compiler. FPMAP Prep with the FPMAP option. By default, PREPs are done specifying neither FPMAP nor NOFPMAP, so the system default is used. You should set the system default by doing the following every time the system is started: SEGMENTER SETFPMAP SYSTEM;UNCONDITION;ON EXIT NOFPMAP overrides the system/session default FPMAP setting and says: I don't want FPMAP information with my program file. NOTE: this isn't a good idea! FPMAP information is very valuable and does not affect program performance. FTN77 or FTN Specifies that the language is FTN77. By default, FORTRAN/V is assumed for FORTRAN CM compiles. See also "FORTRAN" above. HIPRI Adds the "HIPRI" option to the stream file when BATCH is specified. IFCLASSIC IFCM ... IFCM is a conditional flag that tells COMPILE to skip the rest of the input line if the current compilation is a Native Mode compilation. (I.e.: IFCM means IF Compatibility Mode.) IFFILE filename IFLANG langage ... IFLANG checks the current compilation language against the one following "IFLANG". If they match, the rest of the line is interpreted, otherwise the rest of the line is ignored. Example: IFLANG SPL echo this is being compiled with SPL (See note about IFLANG/IFNLANG in the "Globals" discussion later.) IFNLANG langage ... IFNLANG checks the current compilation language against the one following "IFLANG". If they do NOT match, the rest of the line is interpreted, otherwise the rest of the line is ignored. Example: IFNLANG SPL ECHO this must be compiled with SPL IFNM ... IFNM is a conditional flag that tells COMPILE to skip the rest of the input line if the current compilation is a Compatibility Mode compilation. (I.e.: IFNM means IF Native Mode.) Sample Usage: ifcm auxusl foo (mainseg, privseg) ifnm auxobj foonm IFNQEDIT ... IFNQEDIT is a conditional flag that tells COMPILE to skip the rest of the input line if the source file *IS* a QEDIT file. IFQEDIT ... IFQEDIT is a conditional flag that tells COMPILE to skip the rest of the input line if the source file *IS NOT* a QEDIT file. IFSPECTRUM IFTIKTOK IN [= days [, [hours] [, minutes] ] ] ] Does an implicit BATCH, and streams the compile so that it will start after waiting the specified number of days, hours and minutes. Do: :HELP STREAM,ALL for information on this feature. INFO "...." (or: -I "...") This option tells COMPILE to pass the specified INFO string to the compiler at startup time. This is particularly useful in passing C/XL options to the compiler. For example, to compile with the ANSI option, you could use -I "Aa". INPRI = # This option specifies the input priority for batch compiles. INTeractive Tells COMPILE to do the compilation as a son process (i.e.: COMPILE stays alive until the compile/prep is done.) If INT is in the source file, it may be overridden by specifying BATCH on the command line. This is the default mode of operation. JCWS This option tells COMPILE to set the COMPILEFAILS and COMPILEGOODS JCWs (see also the COMPILEJCW section below). JOBGroup (Meaningful only when BATCH is specified) Normally, COMPILE builds a stream file and specifies either your logon group as the compile job's logon group. The JOBGroup command allows a different group to be specified. A groupname of "*" means: use the same group as the source code. JOBQ = jobqname JOBQ tells COMPILE what jobqueue you want the batch job to be submitted to, if you say "BATCH". [no]LDEBUG NOLDEBUG tells COMPILE to pass ";NODEBUG" to LINKEDIT. Default: LDEBUG LINKOnly Tells COMPILE to bypass the compilation phase and to try linking the final program. This typically requires a "-O" command as well. LISTCOMPILEG Tells COMPILEG to list the lines read from the various globals configuration files (see "Globals" section below). NOLISTCOMPILEG tells COMPILEG not to list the lines read from the various globals configuration files. Default: NOLISTCOMPILEG LISTING filename (or: -L filename) Tells COMPILE to direct the compiler's listing output to a file called "filename". Filename may have an asterisk in front of it (i.e.: you can file equate it). If filename has no asterisk, then COMPILE emits a file equation of the form: file SPLLIST = filename;dev=??; [ save | nocctl] The device name is derived as follows: if filename = LP, PP, EPOC, PRINTER then devicename := LP, PP, EPOC, LP; and CCTL is appended to the file equation; else devicename := DISC; If the devicename is DISC, then COMPILE checks to see if an old copy of the listing file exists. If it does, it asks you for permission to purge it. (Unless the LISTING command was found by scanning your source file...then COMPILE assumes that you know what you are doing and automatically purges the file if it is a fixed ASCII file.) The file is then built with a record size of 132 bytes. If not specified, LISTING defaults to $NULL. If you want the listing to appear on $STDLIST, use either of the following forms: LISTING $STDLIST or LISTING * LOCAL LOCAL tells COMPILE to try to use compilers in @.PUB.logonaccount. If a given compiler isn't there, @.PUB.SYS is used. [no]MAP MAP tells COMPILE to pass ";MAP" to LINKEDIT, which causes LINKEDIT to "build a map". MAXDATA = # Specifies a MAXDATA to prep the file with. If not specified, the system default is used. MAXPRI = BS / CS / DS / ES / ### Specifies the maximum priority for the new program. Note: only valid for NM programs. MODCAL Specifies that the language is MODCAL. MODULE Specifies that the resulting USL file should be saved as xxxx.USL, and no prep is to be done. If an old file exists called xxxx.USL, it will be purged iff its file code is USL (1024), otherwise the compilation is aborted. NOTE: if the source file is xxxx.MODULE, then the MODULE option is assumed. After all, the definition of a module group is to hold source files that compile into modules, NOT into programs! In the unlikely (and silly) event that you want to compile a file in the MODULE group and then PREP it as a program the NOMODULE keyword overrides the implicit MODULE keyword and causes a prep to be done. If the source file is xxx.C, then the MODULE option is assumed. NOMPE Tells COMPILE to ignore any MPEEND, MPEMID, or MPESTART directives. MPEEND mpecommandtext The MPEEND command will cause COMPILE to remember an MPE command and execute it after the link/prep is finished. All MPEEND commands are written to a scratch file when encountered. This scratch file is read and executed after the link/prep. If BATCH was selected, then the MPE commands are simply written to the stream file, otherwise they are executed on-line. See also: MPESTART and MPEMID. Note: if you want to run the segmenter after a compile, you will probably want to use the "SEGMENTER" command, and not do "MPEEND SEGMENTER ...". MPEMID mpecommandtext The MPEMID command will cause COMPILE to remember an MPE command and execute it after the compiler is finished and before the prep/link is started. All MPEMID commands are written to a scratch file when encountered. This scratch file is read and executed after the compiler succeeds. If BATCH was selected, then the MPE commands are simply written to the stream file, otherwise they are executed on-line. See also: MPESTART and MPEEND. MPEstart mpecommandtext The MPE command will cause COMPILE to either immediately execute the specified MPE command string (by calling the command intrinsic), or to write it to the stream file being built (if BATCH was requested first). In either case, the MPE commands are executed before the compiler is started. See also: MPEMID and MPEEND. NM Use a Native Mode compiler (e.g. Pascal/XL, not Pascal/3000). CM is the default when running on Classic HP3000s, and NM is the default on HP-PA HP3000s. NMHEAP = # or: NMHEAP # MBs Specifies size of NMHEAP to be passed to LINKEDIT. NMSTACK = # or: NMSTACK # MBs Specifies size of NMSTACK to be passed to LINKEDIT. [no]NOCB NOCB causes PREPs to be done with the ";NOCB" option. NONOCB (the default) makes PREPs not use ";NOCB". OBJect objname (or: -O objname) Tells COMPILE what name the compiled (but not linked) NMOBJ file should be saved on disc as. The default name, for NM compiles, is .O. The OBJECT (or -O) option overrides the default name. When COMPILE is compiling an NM program (as opposed to a module), the intermediate NMOBJ file is usually purged. Using the OBJECT (or -O) option in such a case will cause COMPILE to save the NMOBJ file as the specified name. OCTCOMP Tells COMPILE to post-process a PREPped CM program file with the Object Code Translator. OUTCLASS = 1 | 2 | 3 ... | 13 | 14 | -1 or OUTCLASS = DELETE Tells COMPILE what "outclass" your job output should be printed at, if you also specified BATCH. The default value of OUTCLASS is 1. DELETE tells COMPILE to do a "SET STDLIST = DELETE" at the end of the batch job, if one is produced. This causes the output file to be purged from disc. An outclass of -1 is equivalent to DELETE. PARM = # This option passes the specified PARM value to the compiler of choice. NOTE: this should not be used unless you know what you are doing! The default PARM value is 7, which is what most compilers want. PASCAL Specifies that the language is Pascal or Pascal/XL (depending on CM or NM). PASXDATA = # PASXDATA sets the PASXDATA JCW to the specified value. Presumably, some versions of the Pascal compiler check this and do something with it. PATCH = # Specifies a PATCH size to prep the file with. If not specified, the system default (0) is used. PMAP PMAP tells the PREP process to print the PMAP information when the prep is done. NOPMAP tells the PREP process to not print the PMAP information. (This is the default setting.) PREP PREP tells COMPILE to ignore any NOPREP commands it may have seen, and to go ahead and prepare the program after it compiles. NOPREP tells COMPILE to skip the PREPping of the $OLDPASS file. Note: this can be overridden with the PREP command. Also, if MODULE is true, then NOPREP tells COMPILE to not save the resulting USL file. PRI = BS / CS / DS / ES / ### Specifies the default priority for the new program. Note: only valid for NM programs. PSPL Specifies that the language is PSPL. PURGE filename Tells COMPILE to purge the specified file. If the file does not exist, no message is generated (and no error occurs). If the file exists, it is quietly purged. PURGEQ is like PURGE, but is always quiet. Qedit Q tells COMPILE to try to use a compiler from @.Q.ROBELLE instead of @.PUB.SYS. Note: if the compiler cannot be found, @.PUB.SYS is tried instead. Q is the default for files with filecode 111. NOQ tells COMPILE NOT to use compilers from the Q.ROBELLE group. This is the default unless the source file has a filecode of 111. QFORCE For SPLASH only, forces COMPILE to use SPLASH.Q.ROBELLE (?) (Deprecated) READSOURCE READSOURCE tells COMPILE that it is ok to read the source file specified by a SOURCE command for more commands (default). This option is generally used only when a SOURCE command has been used. NOREADSOURCE tells COMPILE not to read the source file specified by a SOURCE command for more commands. NOTE: NOSCAN is usually what people want, not NOREADSOURCE. See SCAN discussion below. RL filename (or: -R filename) RL tells COMPILE to use the specified RL file when prepping the program. This can be overridden with the NORL command. The default is NORL, unless your user.acct is STAN.SIELER and your language is SPL. NORL tells COMPILE not to prep the usl file with an RL. This is the default for any user other than STAN.SIELER (his default is RL=RL.PUB.SIELER for SPL compiles). This would typically be used on a command line to override an RL command in the file's header. SAVEASM Tells COMPILE to save the assembler file generated by the SPLash! compiler as xxxx.ASM. If a different name is desired, the -A option can be used to specify it. SAVEJOB If specified along with BATCH, SAVEJOB tells COMPILE to save the stream file it builds in order to stream the job. The default name for the saved stream file is sourcefile.JOB (If no JOB group exists, the stream file will left as $OLDPASS) SCAN SCAN tells COMPILE to read the first few lines of the source file and pick up commands found therein. This is the default, and may be overriden with a NOSCAN command in the command line. NOSCAN tells COMPILE NOT to read the first lines of the source file. Instead, all information is given via the command line. This can slightly speed up compilation of an entire group of files where the user already knows the desired language & options. It is also useful when you want to ignore ALL of the commands in the first lines of the program source file. Note: SCAN was true, and COMPILE is reading commands from the source file, and NOSCAN is found, then it is ignored. SEGmenter: commandline Tells COMPILE to invoke the SEGMENTER after the running the compiler (and before doing a PREP), and to do the command that follows the colon. Note: a colon (':') is optional after the command 'SEGmenter'. Example: SEGMENTER: RL=RL.PUB.SIELER SEG: CEASE SEGMENT, FOO Also see the AUXUSL command. NOTE: before the first segmenter command you supply, COMPILE will do an implicit USL $OLDPASS command. If you change to a different USL file, be sure to change back to $OLDPASS so any subsequent PREP (or USL saving) will work correctly! [no]SHARE SHARE tells LINKEDIT that data symbols should be exportable and importable (shared) in the resulting executable. SOURCE filename (or: -S filename) Tells COMPILE to compile the specified file instead of the file that you originally told it to compile. The only place this is useful is from within QEDIT. For example, if you are editing a QEDIT file, FOO.INCLUDE, which is only included by a particular source file, FOO.SOURCE, then the following QEDIT command would result in compile FOO.SOURCE and not FOO.INCLUDE: O FOO.INCLUDE (note: NOT a TEXT command!!) ... editing ... :COMPILE * (assuming the COMPILE udc exists) SPL Specifies that the language is SPL. (Note: NM and SPL implies SPLash!, the Native Mode SPL compiler.) SPLASH Specifies that the language is SPLash!. SPLII Specifies that the language is SPLII. SPLISH Tells COMPILE that the SPLash! compiler is found in the SPLISH account. This keyword is typically used only by the SPLash! R & D team. STACK = # Specifies a STACK size to prep the file with. If not specified, the system default is used. STREAM (Usually used as NOSTREAM, along with BATCH and SAVEJOB) If BATCH is true, then STREAM defaults to true. NOSTREAM tells COMPILE to skip the streaming of a batch compilation. Note: NOSTREAM and BATCH and NOSAVEJOB doesn't make much sense. [no]SYM NOSYM tells COMPILE to pass the "NOSYM" option to the PREP command, and also implies NOFPMAP. SYM tells COMPILE not to pass the "NOSYM" option to the PREP command, and also implies FPMAP. TELL [= user.account] TELL makes batch runs of COMPILE "talkative". When used with the BATCH command, causes COMPILE to build a stream file which will tell you (via the :TELL command) when the batch compile finishes, and when the prep finishes. Regardless of TELL, you will always be told when a batch compile fails. If user.account is omitted, the logon user.account is used. NOTELL tells COMPILE to only send a final "completion" message from a batch compile. This is the default. The TELL command enables a more talkative batch compile job. TERMINATE Tells COMPILE to stop compiling (with no error) the current source file. Usually used when the "real" work of compilation is done with MPESTART commands. UNSAT Specifies the name of a procedure to be specified as the target of otherwise unresovled references at load time. This value is given to the LINKEDIT UNSAT= option. UNUSED UNUSED tells COMPILE to print a list of all identifiers declared but not used in your program. Currently available only for SPL and SPLash!. Note: this option requires the program XREF.PUB.ALLEGRO to be available. NOUNUSED tells COMPILE not to generate a listing of all unused items in the source file (a mini-XREF). NOUNUSED is the default, and is used to override a USED command. USEq filename Tells COMPILE to read more commands from the specified file. USE will complain if the file cannot be opened. USEQ will not complain if the file cannot be opened. USL uslname [ (#records) ] (or: -U uslname or: +U uslname) Tells COMPILE to save the USL/NMOBJ file from the compilation regardless of whether or not a PREP/LINK is to be done. USL and -U tell COMPILE to purge any old copy of uslname. +U tells COMPILE to not purge, but to compile *into* the specified existing usl name. The "(#records)" specifies the size for the new USL file. USLFIX This is a synonym for "CM", added for Alfredo. VARASM Tells COMPILE that the output assembler file for a SPLash! compile should have variable format records instead of fixed format records. The assembler reads fixed format records slightly faster than variable format records. WAIT WAIT tells COMPILE to wait until the compile/prep is done. This is the default mode, and may be changed with the NOWAIT option. NOWAIT tells COMPILE to start the compilation, and then activate the caller of COMPILE. Then, COMPILE stays alive and continues to monitor the compilation. When the compile finishes, the prep is started. When the prep finishes, COMPILE prints a summary statement. NOTE: do not use $OLDPASS/$NEWPASS or start another compile in the same job/session while a NOWAIT compile is in process! WATCHCOMP (for on-line compiles) Tells COMPILE to create & activate the selected compiler, and to stay watchful. "Watchful" means that COMPILE is in a loop waking up about periodically (once a second at first, then less often later on), looking to see if the compiler has terminated. In this mode, COMPILE will re-arm control-Y whenever it comes out of the PAUSE intrinsic. If a control-Y is hit, COMPILE asks if you want to abort the compilation. NOWATCHCOMP disables the watchful mode. Default: WATCHCOMP XL = "xllist" or XL = filename Tells COMPILE to use the specfied XL file (or list of files) when linking the final program. XREF XREF tells COMPILE to produce a cross reference of all of the identifiers used in your program. Note: currently only available for SPL and SPLash!. Also see: UNUSED. Note: this option requires the program XREF.PUB.ALLEGRO to be available. NOXREF tells COMPILE to not do a cross reference (XREF) of the source file. (Note: NOXREF is the default.) ZERODB Tells COMPILE to prep CM programs with ;ZERODB. ------------------------------------------------------------- There are a lot of complementary pairs of options (e.g., SCAN/NOSCAN, WAIT/NOWAIT). The FIRST occurrence of any such option is the one that will be used. Since the INFO string or command line is parsed before any options in the file header, this means that you can easily override options imbedded in the file! ------------------------------------------------------------- Directives ---------- COMPILE has some "directives" that can be used whenever you are at the "Compile:" prompt. Directives are ALWAYS prefixed by a slash (/). The slash tells COMPILE that you are giving it a special command, and not the name of a program to compile. Directives: /CONTINUE See the discussion of /SET AUTOCONTinue. /EXIT Terminates COMPILE. (Synonym of //, and EXIT). /HELP Gets this information. (Synonym of ?). /SET [ON | OFF | TOGGLE] Sets, resets, or toggles the specified option. AUTCONTinue controls the action of COMPILE in batch mode when an error occurs. Normally, an error in compilation (or a syntax error in a COMPILE command/directive) will cause a batch run of COMPILE to quit. If a /CONTINUE or a /SET AUTCONTinue ON is in effect, COMPILE merely notes the error and continues. Default value for batch: false. Default value for interactive: true. A /SET TELL ON causes COMPILE to use TELL commands to tell users with the same user.account about success/failure of compilations. Default value for batch: true. Default value for interactive: false. /SHOW Reports settings of some of COMPILE's variables. ------------------------------------------------------------- COMPILE may be driven by a UDC (via the INFO parameter) or by commands read from $STDINX (e.g., a terminal or a batch STREAM file). It also looks for additional information on the first line of the program source file (which may be a flat file or a QEDIT file.). COMPILE also reads initial configuration commands from a set of global COMPILEG files (see "Globals" section below). For example, assuming that the first line of the file FOO is: <> then the command: RUN COMPILE.PUB;INFO=FOO will compile FOO.logon with the SPL.PUB.SYS compiler into $NEWPASS, prep it with CAP=IA,BA,PH, and save the resulting program file as FOO.PUB. If FOO.logon does not exist, or is not a source file, COMPILE will look in the following groups, in order, for a file to compile. The search stops when the first file is found. Group Implied Language ------ ---------------- SOURCE -none- MODULE -none C C F Fortran77 P Pascal PASCAL Pascal SPL SPL S Assembler (only checked on HP-PA machines) (Except for the SOURCE group, all of the above group names imply MODULE compilations.) COMPILE automatically purges the old program file, but only if it is a file with CODE=PROG or CODE=NMPRG. (When compiling with the MODULE option, COMPILE automatically purges the old NMOBJ or USL file.) Before starting a compilation, COMPILE opens the source file and reads it until it finds either a complete comment (e.g., <<...>>, {...}, (*...*), /*...*/, C (in column 1)), a "BEGIN", "PROGRAM", or "IDENTIFICATION". COMPILE ignores dollarcards while doing this "scan" of the file. If a comment/BEGIN/PROGRAM is found, COMPILE deduces the language as follows: CM or NM or Classic HP-PA text language language ---- -------- -------- ! SPL SPLash! << SPL SPLash! (* Pascal Pascal/XL { Pascal Pascal/XL /* C C/XL * COBOLII COBOL/XL C FORTRAN FORTRAN/XL (only if in column 1) BEGIN SPL SPLash! COMMENT SPL SPLash! PROGRAM xxx ( Pascal Pascal/XL PROGRAM xxx ; Pascal Pascal/XL PROGRAM xxx FORTRAN FORTRAN/XL IDENTIFICATION COBOLII COBOL/XL ; -none- Assembler ###### COBOLII COBOL/XI (i.e: sequence number in first 6 columns) If a comment was found, all of the text within that first comment (which can span multiple lines) is scanned for COMPILE commands. In the process of this scan, COMPILE ignores anything that looks like a file name (e.g: foo.source.sieler), a date (e.g., 86/06/02 or 92.06012125), and a time (e.g., 12:00). Any other words are treated as potential commands...if something is found that is not recognizable, COMPILE notes it but does not treat it as an error. (Exception: unknown commands in a command line from terminal/INFO are treated as errors!) Comments that end in an ampersand (&) cause COMPILE to read the next source line as a continuation line. This is needed for languages like FORTRAN and COBOL that do not have multi-line comments. I typically include a line like one of the following at the start of all of my programs: first line language ---------- -------- <> SPL { foo.source.sieler 86/06/02 cap=ia,ba} Pascal C foo.source.sieler 86/06/02 cap=ia,ba FORTRAN * foo.source.sieler 86/06/02 cap=ia,ba COBOLII The scan is necessary to deduce the language in which to compile the source program, and to pick up options (like the "cap" in the examples above). If you wish, the NOSCAN option may be specified in the command line to prevent reading the source file. The syntax of a compile request is as follows: sourcefilename[.group] [option1 option2 ... ] Don't type the "[" and "]" when specifying the options! The two ways of running COMPILE are: RUN COMPILE.PUB;INFO="sourcefile [option1 ...]" and: RUN COMPILE.PUB sourcefile [option1 ... ] ... sourcefile [option1 ... ] // A UDC to run COMPILE is: compile FILE=" ", A=" ", B=" ", C=" ", D=" ", E=" " RUN COMPILE.PUB;INFO="!FILE !A !B !C !D !E" ************ JCW is set to the number of compiles that failed within a single run of COMPILE. ============================================================== Globals COMPILE usually starts each compilation by first reading initial options from a set of global configuration files. (This can be prevented in several manners) The files (and the order they are read in) are: COMPILEG, COMPILEG.PUB, COMPILEG.PUB.ALLEGRO, COMPILEG.PUB.SYS Generally, only boolean options are likely to be desirable in a COMPILEG file (e.g., BATCH, Q, AUTOPRGLIST, DUMPWORTHY). Why? Because COMPILEG options override INFO options, which in turn override source-file options. You can prevent COMPILE from reading any COMPILEG files by either setting bit 12 of the COMPILEJCW jcw (see "COMPILEJCW" below) or by running COMPILE with PARM bit 12 set. (E.g., PARM=8) You can request that all COMPILEG files are listed by either setting bit 11 of the COMPILEJCW jcw (see "COMPILEJCW" below) or by running COMPILE with PARM bit 11 set. (E.g., PARM=16) You can prevent COMPILE from reading COMPILEG.PUB and COMPILEG.PUB.ALLEGRO and COMPILEG.PUB.SYS by putting "NOCOMPILEG" in your local COMPILEG file. Similarly, you can prevent COMPILE from reading COMPILEG.PUB.ALLEGRO, COMPILEG.PUB.SYS by putting "NOCOMPILEG" in your COMPILEG.PUB file. IFLANG / IFNLANG vs. COMPILEG IFLANG and IFNLANG are unlikely to be of use in a COMPILEG file, because the language type has not been determined yet. But, what if you wanted to specify an option that always gets invoked for a C compile (e.g., "auxobj libcinit.lib.sys)? One way is to use a UDC like COMPILEC, which is dedicated to compiling in C. It could do: ... FILE COMPILEG = COMPILEG.C RUN COMPILE.PUB.ALLEGRO; ... where COMPILEG.C has in it: C auxobj libcinit.lib.sys ============================================================== Philosophy of compilation. COMPILE always compiles into $NEWPASS, and then (if a prep is wanted) prepares $OLDPASS into $NEWPASS. If the compile is successful, one of three things happens: 1) if NOPREP was specified, we are done. 2) else, if the file was a "module" rather than a "source" file, the USL file is saved as a permanent file. The name defaults to xxx.USL, unless a "-O" or "AS" command was seen. (The old USL file is purged first.) 3) else, the file is prepped into $NEWPASS If the prep succeeds, the old program file is purged and the new one is save as a permanent file as "xxx.PUB" (unless a "-O" or "AS" was seen). In either case, the temp USL file is purged. In short, COMPILE will not purge your old usl/program file. UNLESS it succeeded in compiling/prepping a new one. Also, because of the usage of $OLDPASS / $NEWPASS, you cannot do more than one compile at a time, even using the NOWAIT option. NOWAIT is designed to let you start a compile from a program (e.g., QEDIT) and then return to that program while the compile is still in process. Note: "prep" means: for a CM compile, run the SEGMENTER and do a PREP command; for an NM compile, run LINKEDIT and produce an NM program file. ============================================================== COMPILEJCW COMPILE checks for a JCW called "COMPILEJCW" at the start of the program, and before every interactive prompt. If the JCW is found, various bits of it are interpreted as follows: COMPILEJCW Bit # Value Meaning when on (1) ----- ------ -------------------------------- 15 1 CM is implied by default (instead of using machine type to determine the default CM/NM) (see also: CM option) 14 2 CONTINUE is on (see also: CONTINUE option) 13 4 LOCAL (use compilers in pub.logon) (see also: LOCAL option) 12 8 NOCOMPILEG is assumed (affects reading compileg.*) (see "Globals" section above) (see also: [no]COMPILEG opion) 11 16 LISTCOMPILEG is on (see also: LISTCOMPILEG option) 10 32 read/set COMPILE* JCWs (see below) (see also: JCWS option) 9 64 use 'TELL' from batch to report progress (see also: TELL option) For example, to force COMPILE on a HP-PA HP3000 to default to CM compilations (unless an explicit NM option is seen), you can use: SETJCW COMPILEJCW 1 With the introduction of MPE XL (and MPE/iX) on the HP-PA architecture has come a flurry of new buzz words, like: CM and NM. CM means Compatibility Mode program, which is HP3000 machine code. NM means Native Mode program, which is HP-PA machine code. An NM program file has a file code of NMPRG (1030), and a CM program has a file code of PROG (1029). A "Spectrum" machine is another phrase for an HP-PA machine. HP-PA means "Hewlett-Packard Precision Architecture". ============================================================== JCWS If you've asked COMPILE to update JCWS, then it will increment several JCWs to let job scripts track what's happening. (Any jcw that didn't exist is set to 0 the first time it's accessed.) There are three JCWs: COMPILEFAILS 0 if all compiles worked, otherwise the number of compiles that failed COMPILEGOODS 0 if all compiles failed, otherwise the number of compiles that succeeded. ============================================================== COMPILE PARM bits: debug1 = debug'flags.(15:01) #, ! 1 debug2 = debug'flags.(14:01) #, ! 2 debug'oldpass = debug'flags.(13:01) #, ! 4 debug'no'compileg = debug'flags.(12:01) #, ! 8 debug'list'compileg = debug'flags.(11:01) #, ! 16 debug'seg = debug'flags.(10:01) #, ! 32 debug'cont = debug'flags.(09:01) #, ! 64 ============================================================== // COMPILE 20240324 by Stan Sieler (sieler@allegrosupport.com)