home *** CD-ROM | disk | FTP | other *** search
- /**
- ** $VER: compile.s2c 2.0 (19.12.91)
- **
- ** for sas2ced v2.2
- **
- ** Written by Doug Keller
- **/
-
- address 'rexx_ced'
-
- options results
-
- /* If you are not using wshell using this line, and comment the next line
-
- UserShell = 'Newshell "con:100/217/500/255/AmigaShell/alt100,18,500,454/close"'
- */
-
- UserShell = 'NewWsh "con:100/217/500/255/WShell/alt100,18,500,454/close"'
-
- 'status 18'
- if result ~= 0 then do
- 'status 21'
- isfn=result
- 'save'
- if result = 0 then do
- if isfn > 0 then do
- okay1 "Save Error- File not saved"
- exit
- end
- end
- end
-
- command= '18'X || 'lmk' || '0d'X
-
- 'status 19'
- filename=result
-
- if open('infile', filename, 'r') = 0 then exit
-
- do for 10
- line=readln('infile')
- lpos=pos('compile:', line)
- if lpos ~= 0 then do
- command= '18'X || strip(substr(line, lpos+8),'l', ' ') || '0d'X
-
- lpos=pos('$*', command)
- if lpos ~= 0 then do
- command= delstr(command, lpos, 2)
- 'status 21'
- command= insert(result,command,lpos-1)
- end
- leave
- end
- end
- close('infile')
-
-
- if command == ('18'X || 'lmk' || '0d'X) then do
- 'status 20'
- path=result
- if( 0=(exists(path || '/lmkfile') | exists(path || '/makefile') | exists(path || 'makefile') | exists(path || 'lmkfile'))) then do
- 'status 21'
- command = '18'X || 'lc -L ' || result || '0d'X
- end
- end
-
- if command == ('18'X || '0d'X) then command= '18'X || 'lmk' || '0d'X
-
- 'status 20'
- path=result
-
- address 'SAS2CED'
- 'compile' '"'path'"' command /* Make sure path is QUOTED */
-
- if RC = 5 then do
- if open('s2ctemp', 't:s2c_temp', 'w') then do
- d=writeln('s2ctemp', "execute s:wshell-startup")
- tpath= 'cd ' || path
- d=writeln('s2ctemp', tpath)
- d=close('s2ctemp')
- address command UserShell || 'from t:s2c_temp'
-
- 'compile' '"'path'"' command /* Make sure path is QUOTED */
- do for 5 until RC ~= 5
- address command 'wait'
- 'compile' '"'path'"' command /* Make sure path is QUOTED */
- end
- end
- end
-