home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / cygcc.lha / CygCC next >
Encoding:
Text File  |  1990-08-24  |  1.9 KB  |  93 lines

  1. /*   *************CYGCC*******                      */
  2. nl='0A'X
  3. stacksize=40000
  4. if address()~='rexx_ced' then do
  5. say 'This prog must be run from within CygnusEd'
  6. say 'Press RETURN to continue'
  7. pull answer
  8. exit
  9. end
  10. options results
  11. 'Status 17'
  12. nlines = result
  13. 'Status 19'
  14. fullname = result
  15. 'Status 20'
  16. pathname = result
  17. 'Status 21'
  18. filename = result
  19. if filename ='' then do
  20. 'okay1 Source filename not defined'
  21. exit 
  22. end
  23.  
  24. barename=''
  25. dotpos = lastpos('.',filename)
  26. if dotpos>0 then do
  27. ext = right(filename,length(filename)-dotpos)
  28. if upper(ext) = 'C' then
  29. barename=left(filename,dotpos-1)
  30. end
  31.  
  32. if barename='' then do
  33. 'okay1 Error: Filename does not end in ".C"'
  34. exit
  35. end
  36. if right(pathname,1)~=':' then
  37. pathname=pathname||'/'
  38. call setclip('CygCC_NLines',nlines)
  39. 'SAVE'
  40. if FindWind('Compiler_Window') then 'Quit 1'
  41. 'Open New'
  42. 'Open Compiler_Window'
  43. 'Text Compiling' fullname||nl
  44. 'stautus 34'
  45. if result then 'esc codes visible'
  46. address command,
  47. 'c:stack' stacksize nl,
  48. 'c:lc1 >t:phase1 -oquad:' fullname
  49. cc_err_count = ReadErrors('T:phase1','LC1')
  50. if (cc_err_count=0) then do 
  51. address command,
  52. 'c:stack' stacksize nl,
  53. 'c:lc2 >t:phase2 quad:' ||barename
  54. cc_err_count =ReadErrors('T:phase2','LC2')
  55.  
  56. if (cc_err_count=0) then do 
  57. if exists(pathname||barename||'.lnk') then do
  58. 'Text linking WITH' pathname||barename||'.lnk'||nl
  59. address command,
  60. 'c:stack' stacksize nl,
  61. 'c:cd' pathname nl,
  62. 'c:blink >t:link WITH',
  63.  pathname||barename||'.lnk'
  64. end;else do
  65. 'Text Linking' pathname||barename||'.o'||nl
  66. address command,
  67. 'c:stack' stacksize nl,
  68. 'c:blink >t:link FROM lib:c.o',
  69. 'quad:'||barename||'.o TO 'pathname||barename,
  70. 'LIBRARY lib:lc.lib lib:amiga.lib BATCH'
  71. end
  72. lnk_err_count=ReadErrors('T:link','LINK')
  73. end
  74. end
  75. if cc_err_count>0 then do
  76. 'Beg of File'
  77. 'Mark Block'
  78. call NextErr()
  79.  
  80. end; else do
  81. if lnk_err_count=0 then 
  82. message='Success!'
  83. else 
  84. message='Link Failed..... :-<('
  85. 'okay2' message 'delete compiler window?'
  86. if result then 
  87. 'quit 1' 
  88. exit
  89. end
  90. 'beg of file'
  91. 'mark block'
  92. FindWind(filename)
  93.