.; File: BUILDTSK.CMD Last Edit: 7-AUG-1989 14:18:47 .; .; History: .; .; 5-May-86. Philip Hannay. Created. .; .; 22-Sep-86. Philip Hannay. Added code to run under DCL. .; .; 24-Jan-87. Philip Hannay. Modified so that if no MOD file found, .; just build main object module and leave object behind. This will .; permit us to to build a program that uses another programs library. .; .; 11-Mar-87. Philip Hannay. Enhanced to handle compilation and .; building of CRISP logic programs. .; .; 21-Jul-87. Philip Hannay. Fixed EPT/MNT numbers in LBR command .; (they had been reversed), changed defaults to multiples of .; 64 (we said 50, but they were being rounded up), and added .; help function. .; .; 20-Aug-87. Philip Hannay. Fixed purging of source files when .; compiling single source file and compile is successful - source .; file is now purged. Also purge of TKB after successful or warning .; taskbuild. .; .; 21-Aug-87. Philip Hannay. Added test for assembler command file .; srcfilename.ASM when doing a macro assembly. If found, we use .; the ASM file to do the assembly. Added ONERR processing to make .; sure log file closed (so not locked) and CLI restored. .; .; 30-Nov-87. Philip Hannay. Fixed bug caused by CRP enhancement when .; building multimodule (library) program, also detect of log file .; open failure. (8-Apr-87 Bergen mods) .; .; 16-May-87. Philip Hannay. Fixed bug where we tried to alter value .; of special symbol. RSX V3.0 ignored .setn, V4.0 gave .; syntax error. Also BUILDTSK no longer purges source files .; include TKB and ODL files, leaving it up to programmer to .; purge sources when appropriate. PA3 default changed from LIST .; to ERROR to shorten listing to minimum. .; .; 9-Nov-88. Bob Thomas. Provided for a /DEBUG switch to be applied .; to the file name which results in a fortran compile with the .; /DE switch on. .; .; 20-Jun-89. Philip Hannay. Made all PASCAL 2.1 (PA3) builds to .; use the DOUBLE switch for double precision reals. And fixed .; CRISP (CRP) build to search for, and if found, build all .; CRP sources from xxxx00 thru xxxx07. .; .; 7-Aug-89. Philip Hannay. Added check for xxxxOV.TKB file, skips .; the TKB if file not found. .enable substitution .; See if HELP is being solicited .if p1 eq "?" .goto help .if p1 eq "/HE" .goto help .; normal run .goto nohelp .help: ; ; ; @BUILDTSK is a generic task build command file that will rebuild a task ; from scratch. It will delete any existing object library for the ; task and create an empty object file library, and populate ; that library using BUILDLBR command file, and then task build the task ; against the newly populated library. The library build is controlled ; by a modulator file taskname.MOD that states the name of the library ; and the modules that make up that library. (For info on MOD file ; syntax, see @BUILDLBR ? help). ; ; IF A MOD FILE IS NOT SPECIFIED, this implies that there is ONLY ONE ; module, and thus a library is not needed. In this case, a search of ; the default directory is made for a source file that matches the ; task name (jobnam) supplied. It is then compiled, and the OBJ file ; left behind for the taskbuild to use. ; ; The following source files are recognized. When no MOD file is ; specified, the search of the default directory for the specified source ; file occurs in the order that the source files are listed. ; ; .SRC - Pascal-1 ; .PAS - Pascal-2 ; .FTN - current FORTRAN compiler invoked by MCR command FOR ; .MAC - Macro-11 ; .CRP - CRISP-11 ; ; If all source files compile successfully (no errors or warnings), then a ; taskbuild will be attempted. BUILDTSK will first look for a taskbuild ; command file called taskname.TKB, and if not found, tasknameOV.TKB. The ; TKB file will then be given to TKB for the taskbuild. The tasknameOV.TKB ; taskbuild file is our conventional name (adding the OV suffix) for ; a taskbuild command file that will invoke an overlay (ODL) file, while ; the taskname.TKB file does not use an ODL file. ; ; In all cases, a log file taskname.LOG is kept showing starting and ; ending times, module compilation status, library insertion status, ; and task build status. If a log file already exists, the log info will ; be appended to that existing log file. ; ; Automatic cleanup and purging will be done as successful compilation and ; taskbuilding is done. Anytime an error occurs, the purging will not be ; done, and the listing files needed for diagnosing the error will be ; left behind. ; ; The command file will accept parameters, or if none, will prompt for ; the parameters. The following parameters will be used. They are ; normal command file parameters - so they are separated by a space ; AND NOT separated by commas. ; ; = Name of task to build. Command file will look for one of the ; following files: .MOD, .SRC, .PAS, ; .FTN, .MAC, .CRP, to control compilation ; and creation of library (OLB) or single object module (OBJ) ; It will then look for one of the following files: .TKB ; or OV.TKB, to control the task building. ; ; The task name can be followed with a /DEBUG switch which ; results in Fortran compiles with the /DE switch added. ; ( /DEBUG ) ; ; = Number of decimal blocks to allocate for the object ; library. The default will be 30. ; ; = Number of object modules that will be placed in the ; library. The defualt will be 64. This number will also ; determine the number of entry points allowed, which will ; be twice . ; ; ; The command file can be invoked with the command line ; @BUILDTSK . ; ; If no parameters are present, the user will be prompted for the ; values. If is the only parameter specified, the defaults ; of 30. and 64. will be used for and . ; ; HELP is available by using the parameter "?" or "/HE". The above is ; the HELP text. Remember that invoking the command file without parameters ; will ask you for each option with explanations. ; .goto 990 .nohelp: .; See if we are running in DCL .; .sets curcli .if curcli ne "MCR" mcr set /cli=ti:mcr .; .setf badend .; Badend will signal if an error occurred so that we can exit with the .; appropriate error status, in case we are being called by another .; indirect command file. .; .setf fatend .; Fatend will signal if a fatal error (detected by .onerr) has occurred. .; .onerr 910 .; If a fatal indirect error detected, go to 910 for cleanup .; check for parameter 1 .; .test p1 .if eq 0 .goto norem .; .; parameter 1 supplied, it is the task name to build. .sets jobnam p1 .; .; check for parameter 2 .; .test p2 .if eq 0 .goto nop2 .; .; parameter 2 supplied, use it for library block size (decimal) .; .setn libsiz 'p2'. .goto donep2 .; .nop2: .; .; parameter 2 not supplied, use defualt of 30. .; .setn libsiz 30. .; .donep2: .; .; check for parameter 3 which is number of modules allowed in library .; and half the number of entry points (calls) allowed. .; .test p3 .if eq 0 .goto nop3 .; .; parameter 3 supplied, use it for module number and entry point number .; .setn modnum 'p3'. .setn entnum modnum*2 .goto donep3 .; .nop3: .; .; parameter 3 not supplied, use default of 64. .; .setn modnum 64. .setn entnum modnum*2 .; .donep3: .; .; .; All variables initialized, onward to actual processing .; .goto dolib .; .; .norem: .; .; No parameters supplied. Prompt operator for particulars. .; ; ; This command file will create a new object library, compile all modules ; and place the resulting objects in the library, and then task build the ; job. You may abort this command file at any time. It is restartable. ; ; You need to specify the name of the task to build. This name will also ; determine the name of the MOD file used by BUILDLBR to compile the ; the tasks and the name of the TKB file used by TKB to task build the ; task. Enter just the name if you are running in the UFD where the ; modules and control files are, or the disk and UFD prefixes if you ; are not. Like "BOOKGW" or "[115,305]BOOKGW" or "TB:[115,305]BOOKGW". ; ; .asks jobnam name of task to build .; ; ; Now you need to specify the size of the library where the object ; modules will be placed. It is the decimal size. If you are not sure ; use the default. ; .askn [::30.] libsiz size of object library .; ; ; Now you need to specify the maximum number of object modules that will ; be placed in that library. It is the decimal number. If you are not ; sure, use the default. This number will also determine the maximum ; number of entry points allowed. That number will be twice the max ; number of object module. (Entry points are "procedure" or "subroutine" ; headings - ususally only one per module, but sometimes more.) ; .askn [::64.] modnum maximum number of object modules in library .setn entnum modnum*2 .; .; .dolib: .; .; parameters are in, ready to build library .; .; First parse any switches from the end of the file name .Parse jobnam "/" jobnam switch .; .; Define a variable "DEBUG" and set it true if the /DEBUG switch is present .setf debug .if switch eq "DEBUG" .sett debug .if switch eq "Debug" .sett debug .if switch eq "debug" .sett debug .; .setf badend .; Badend will signal if an error occurred so that we can exit with the .; appropriate error status, in case we are being called by another .; indirect command file. .; .; We log all notes of success and errors to a log file bearing the .; name . Note we use append so that others may use it before .; us and their notes will be preserved. It will be up to the operator .; to decide when to delete the accumulated log notes. Log will also be .; used by BUILDLBR command file for its notes. .; .opena 'jobnam'.log .if ne 1 .goto 920 .; .; .data .data 'jobnam' compile and build execution starting '' '