home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D2.DMS / in.adf / ObSup_Scripts / CygnusEd / Cmd.ced < prev    next >
Encoding:
Text File  |  1992-08-01  |  2.7 KB  |  112 lines

  1. /* ------------------------------------------------------------------------
  2.   :Program.       Cmd.ced
  3.   :Contents.      Start Oberon tools with CygnusEd Professional
  4.   :Author.        Kai Bolay [kai]
  5.   :Address.       Snail-Mail:              E-Mail:
  6.   :Address.       Hoffmannstraße 168       UUCP: kai@amokle.tynet.sub.org
  7.   :Address.       D-7250 Leonberg 1        FIDO: 2:247/706.3
  8.   :History.       v1.0 [kai] 12-Mar-92
  9.   :History.       v1.1 [kai] 26-Mar-92 (+ first error after compilation
  10.   :History.                             + show error only if error)
  11.   :History.       v1.2 [kai] 05-May-92 (+ check for returnvalue, + make)
  12.   :Version.       $VER: Cmd 1.2 (05-May-92)
  13.   :Copyright.     FD
  14.   :Language.      ARexx
  15.   :Translator.    RexxMast
  16.   :Remark.        LibLink, Execute, etc. not supported yet
  17.   :Bugs.          CygnusEd crashes when "address command execute" fails
  18. ------------------------------------------------------------------------ */
  19.  
  20. options results
  21.  
  22. arg tool
  23.  
  24. select
  25.   when tool = "COMPILE" then do
  26.     scriptname = "T:Compiler-Start"
  27.     save
  28.   end
  29.   when tool = "MAKE" then do
  30.     scriptname = "T:Make-Start"
  31.     save
  32.   end
  33.   when tool = "LINK" then do
  34.     scriptname = "T:Linker-Start"
  35.   end
  36.   otherwise do
  37.     Okay1 "Fehler: Falscher Aufruf!"
  38.     exit
  39.   end
  40. end
  41.  
  42.  
  43. status 21 /* Nur Filnamen (ohne Pfad) holen */
  44. filename = result
  45.  
  46. if filename = "" then do
  47.   Okay1 "Fehler: Kein Filename"
  48.   exit
  49. end
  50.  
  51. if right(filename,4) ~= ".mod" then do
  52.   Okay1 "Fehler: Filename endet nicht auf '.mod'"
  53.   exit
  54. end
  55. filename = left(filename,length(filename)-4)
  56.  
  57. status 20 /* Nur Pfad (ohne Filenamen) holen */
  58. path = result
  59.  
  60. if length(path) > 3 then do
  61.   if right(path,3) = "txt" then do
  62.     path = left(path,length(path)-3)
  63.   end
  64. end
  65.  
  66. if ~open(script,scriptname,'W') then do
  67.   Okay1 "Fehler: Kann Script nicht öffnen"
  68.   exit
  69. end
  70.  
  71. call writeln(script,"FailAt 100")
  72. call writeln(script,"Stack 20000")
  73. call writeln(script,"CD" path)
  74. window = ">CON:0/100//200/Oberon/SCREENCygnusEdScreen1"
  75. select
  76.   when tool = "COMPILE" then do
  77.     cmd = "Oberon" window AddOpts("-", "OberonOpts")
  78.   end
  79.   when tool = "MAKE" then do
  80.     cmd = "OMake" window AddOpts("c-", "OberonOpts") AddOpts("l-", "OLinkOpts")
  81.   end
  82.   when tool = "LINK" then do
  83.     cmd = "OLink" window AddOpts("-", "OLinkOpts")
  84.   end
  85. end
  86. cmd = cmd filename
  87.  
  88. call writeln(script,cmd)
  89.  
  90. if ~close(script) then do
  91.   Okay1 "Fehler: Kann Script nicht schließen"
  92.   exit
  93. end
  94.  
  95. address command Execute scriptname
  96.  
  97. if RC ~= 0 then do
  98.   if tool = "COMPILE" then do
  99.     address REXX "OBERON:rexx/Err.ced FIRST"
  100.   end; else do
  101.     Okay1 "Fehler: Aufruf fehlgeschlagen!"
  102.   end
  103. end
  104.  
  105. exit
  106.  
  107. AddOpts:
  108.   parse arg switch,name
  109.   opts = getclip(name)
  110.   if opts ~= "" then opts = switch || opts
  111. return opts
  112.