home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / ace_gpl_release / bin / newbas < prev    next >
Encoding:
AmigaDOS Script File  |  1996-08-28  |  2.1 KB  |  87 lines

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