home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 91 / af091a.adf / af91a2.lzx / bin / bas < prev    next >
AmigaDOS Script File  |  2018-01-22  |  2KB  |  95 lines

  1. .key arg1,arg2,arg3
  2.  
  3. ; ** Preprocess, 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.  IF EXISTS <arg2>.bas
  19.    ;try ".bas" extension
  20.    set source <arg2>.bas
  21.  ELSE
  22.    ;assume ".b" extension
  23.    set source <arg2>.b    
  24.  ENDIF
  25.  
  26.  ; preprocess source file.
  27.  app $source ram:t/$source
  28.  IF NOT ERROR
  29.  
  30.    ; compile preprocessed source file.
  31.    ace <arg1> ram:t/$source
  32.  
  33.    IF NOT ERROR
  34.      ; assemble and link
  35.      delete >NIL: ram:t/$source
  36.      a68k ram:t/<arg2>.s
  37.      delete >NIL: ram:t/<arg2>.s
  38.      Blink ram:t/<arg2>.o LIB <arg3>+ACElib:startup.lib+ACElib:db.lib+
  39.                   ACElib:ami.lib ;SMALLCODE SMALLDATA
  40.  
  41.      ; leave us with the executable (and icon?).
  42.      copy ram:t/<arg2> ""
  43.  
  44.      IF EXISTS ram:t/<arg2>.info
  45.        copy ram:t/<arg2>.info ""
  46.      ENDIF
  47.  
  48.      ; kill any remaining temporary files.
  49.      delete >NIL: ram:t/<arg2>#?
  50.    ENDIF
  51.  
  52.  ENDIF
  53.  
  54. ELSE 
  55.  
  56.  ; no compiler options: <arg1> = ACE source file.
  57.  ;            <arg2> = extra object module/library to link.
  58.  
  59.  IF EXISTS <arg1>.bas
  60.    ;try ".bas" extension
  61.    set source <arg1>.bas
  62.  ELSE
  63.    ;assume ".b" extension
  64.    set source <arg1>.b    
  65.  ENDIF
  66.  
  67.  app $source ram:t/$source
  68.  
  69.  IF NOT ERROR
  70.  
  71.    ; compile source file.
  72.    ace ram:t/$source
  73.  
  74.    IF NOT ERROR
  75.      ; assemble and link.
  76.      delete >NIL: ram:t/$source
  77.      a68k ram:t/<arg1>.s 
  78.      delete >NIL: ram:t/<arg1>.s
  79.      Blink ram:t/<arg1>.o LIB <arg2>+ACElib:startup.lib+ACElib:db.lib+
  80.                        ACElib:ami.lib ;SMALLCODE SMALLDATA
  81.  
  82.      ; leave us with the executable (and icon?).
  83.      copy ram:t/<arg1> ""
  84.    
  85.      IF EXISTS ram:t/<arg1>.info
  86.        copy ram:t/<arg1>.info ""
  87.      ENDIF
  88.     
  89.      ; kill any remaining temporary files.
  90.      delete >NIL: ram:t/<arg1>#?
  91.    ENDIF
  92.  ENDIF
  93.  
  94. ENDIF
  95.