home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d969 / ace.lha / ACE / ACE-2.0.lha / MAIN.lha / bin / bas < prev    next >
AmigaDOS Script File  |  1994-01-19  |  2KB  |  78 lines

  1. .key arg1,arg2,arg3
  2.  
  3. ; ** compile, assemble and link an ACE program **
  4.  
  5. ; make sure stack is big enough.
  6. STACK 40000
  7.  
  8. ; don't abort script if ACE or APP quits 
  9. ; with a return code of 10 (ERROR).
  10. FAILAT 11
  11.  
  12. IF <arg2> GT ""
  13.  
  14.  ; at least 2 arguments: <arg1> = compiler options.
  15.  ;             <arg2> = ACE source file.
  16.  ;             <arg3> = extra object module/library to link.
  17.  
  18.  ; preprocess source file.
  19.  app <arg2>.b ram:t/<arg2>.b
  20.  IF NOT ERROR
  21.  
  22.    ; compile preprocessed source file.
  23.    ace <arg1> ram:t/<arg2>
  24.  
  25.    IF NOT ERROR
  26.      ; assemble and link
  27.      delete >NIL: ram:t/<arg2>.b
  28.      a68k ram:t/<arg2>.s 
  29.      delete >NIL: ram:t/<arg2>.s
  30.      blink ram:t/<arg2>.o LIB <arg3>+ACElib:startup.lib+ACElib:db.lib+
  31.                   ACElib:ami.lib SMALLCODE SMALLDATA
  32.  
  33.      ; leave us with the executable (and icon?).
  34.      copy ram:t/<arg2> ""
  35.  
  36.      IF EXISTS ram:t/<arg2>.info
  37.        copy ram:t/<arg2>.info ""
  38.      ENDIF
  39.  
  40.    ENDIF
  41.  
  42.  ENDIF
  43.  
  44. ELSE 
  45.  
  46.  ; no compiler options: <arg1> = ACE source file.
  47.  ;            <arg2> = extra object module/library to link.
  48.  
  49.  app <arg1>.b ram:t/<arg1>.b
  50.  
  51.  IF NOT ERROR
  52.  
  53.    ; compile source file.
  54.    ace ram:t/<arg1>
  55.  
  56.    IF NOT ERROR
  57.      ; assemble and link.
  58.      delete >NIL: ram:t/<arg1>.b
  59.      a68k ram:t/<arg1>.s 
  60.      delete >NIL: ram:t/<arg1>.s
  61.      blink ram:t/<arg1>.o LIB <arg2>+ACElib:startup.lib+ACElib:db.lib+
  62.                        ACElib:ami.lib SMALLCODE SMALLDATA
  63.  
  64.      ; leave us with the executable (and icon?).
  65.      copy ram:t/<arg1> ""
  66.    
  67.      IF EXISTS ram:t/<arg1>.info
  68.        copy ram:t/<arg1>.info ""
  69.      ENDIF
  70.  
  71.    ENDIF
  72.  ENDIF
  73.  
  74. ENDIF
  75.  
  76. ; kill any remaining temporary files.
  77. delete >NIL: ram:t/<arg2>#?
  78.