.; File: [22,311]BUILD.CMD      Last edit: 9-MAY-1989 18:12:05 

.enable substitution

.sets tst p1
.if tst ne "" .goto tstin
;
;  Compile and build a specified test program for P3UTIL library
;  routine(s).  You supply the name of a test routine like
;  TSTSWRITE and we will PA3 that source file, create a task build
;  file, and task build it.  
;
;  Command file can be run with parameters:
;
;  @BUILD <sourcename> <cleanup>
;     <sourcename> is name of file without extension
;     <cleanup> is Y or N, where Y will delete all but SOURCE and TSK files.
;
;  Enter the name of the test program to build like TSTSTLO.  Do not enter
;  the extension or version.  Remember, to exit now, type CTRL-Z.
;
.asks tst Enter name of test program (no extension)
;
.tstin:
;
; Task build will be done against PAS$UTL:P3UTIL and PAS$LIB (PA3LIB)
;
.open 'tst'.tkb
.enable data
'tst','tst'/-SP='tst'
pas$utl:p3util/lb
pas$lib/lb
/
gblpat='tst':p$natt:240
;libr=pa3cls:ro
;libr=fcsres:ro
//
.disable data
.close

.; use BUILDTSK to build task

@BUILDTSK 'tst'
.if <exstat> ne 1 .goto badend
.if p2 ne "" .goto respin
;
.ask resp Do you want to delete all but source and TSK file
.iff resp .sets p2 "N"
.ift resp .sets p2 "Y"
;
.respin:
.if p2 ne "Y" .if p2 ne "y" .goto done
pip 'tst'.obj;*,.tkb;*,.map;*,.lst;*,.log;*/de/nm
.done:
.exit 1
.badend:
.exit 2
