home *** CD-ROM | disk | FTP | other *** search
- /* *************CYGCC******* */
- nl='0A'X
- stacksize=40000
- if address()~='rexx_ced' then do
- say 'This prog must be run from within CygnusEd'
- say 'Press RETURN to continue'
- pull answer
- exit
- end
- options results
- 'Status 17'
- nlines = result
- 'Status 19'
- fullname = result
- 'Status 20'
- pathname = result
- 'Status 21'
- filename = result
- if filename ='' then do
- 'okay1 Source filename not defined'
- exit
- end
-
- barename=''
- dotpos = lastpos('.',filename)
- if dotpos>0 then do
- ext = right(filename,length(filename)-dotpos)
- if upper(ext) = 'C' then
- barename=left(filename,dotpos-1)
- end
-
- if barename='' then do
- 'okay1 Error: Filename does not end in ".C"'
- exit
- end
- if right(pathname,1)~=':' then
- pathname=pathname||'/'
- call setclip('CygCC_NLines',nlines)
- 'SAVE'
- if FindWind('Compiler_Window') then 'Quit 1'
- 'Open New'
- 'Open Compiler_Window'
- 'Text Compiling' fullname||nl
- 'stautus 34'
- if result then 'esc codes visible'
- address command,
- 'c:stack' stacksize nl,
- 'c:lc1 >t:phase1 -oquad:' fullname
- cc_err_count = ReadErrors('T:phase1','LC1')
- if (cc_err_count=0) then do
- address command,
- 'c:stack' stacksize nl,
- 'c:lc2 >t:phase2 quad:' ||barename
- cc_err_count =ReadErrors('T:phase2','LC2')
-
- if (cc_err_count=0) then do
- if exists(pathname||barename||'.lnk') then do
- 'Text linking WITH' pathname||barename||'.lnk'||nl
- address command,
- 'c:stack' stacksize nl,
- 'c:cd' pathname nl,
- 'c:blink >t:link WITH',
- pathname||barename||'.lnk'
- end;else do
- 'Text Linking' pathname||barename||'.o'||nl
- address command,
- 'c:stack' stacksize nl,
- 'c:blink >t:link FROM lib:c.o',
- 'quad:'||barename||'.o TO 'pathname||barename,
- 'LIBRARY lib:lc.lib lib:amiga.lib BATCH'
- end
- lnk_err_count=ReadErrors('T:link','LINK')
- end
- end
- if cc_err_count>0 then do
- 'Beg of File'
- 'Mark Block'
- call NextErr()
-
- end; else do
- if lnk_err_count=0 then
- message='Success!'
- else
- message='Link Failed..... :-<('
- 'okay2' message 'delete compiler window?'
- if result then
- 'quit 1'
- exit
- end
- 'beg of file'
- 'mark block'
- FindWind(filename)
-