.key object

;; Sound Tools Make script for AMIGA
;; 	builds libst.lib and sox
;;
;; To make both FPU and non-FPU versions, 
;;	1) "maker sox" (or "maker")
;;	2) delete ';' characters in lines 59-62 of this file
;;	3) "maker sox881" (or "maker")

set FSRC amiga.c raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c sbdsp.c
set ESRC copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c 
set PSRC sox.c

set LIBSOURCES    handlers.c libst.c misc.c getopt.c
set SOURCES       $PSRC $FSRC $ESRC $LIBSOURCES

set HEADERS     amiga.h st.h libst.h sfheader.h patchlevel.h 

set TESTS       tests.sh monkey.au monkey.voc

set MISC        README INSTALL TODO sox.man st.man Makefile

;; we assume skel is good; it's not designed to compile, anyway
set SKEL        skel.c skeleff.c

set FILES      $MISC $HEADERS $SOURCES $TESTS $SKEL

;; sbdsp.c is a driver for the IBMoid SoundBlaster gadget...not compiled for Amiga
set FOBJ amiga.o raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o ;sbdsp.o
set EOBJ copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o 

;;Not needed because of FPU option...see below
;SOUNDLIB  = libst.a
set LIBOBJS    handlers.o libst.o misc.o getopt.o

;; Amiga vars for SAS 5.10+.
;; Lots of funky stuff here.  Unnecessary, but keeps it neat.
;; Also matches unix makefile more closely, toward the day when
;; we can use the same one.
;;
set CC	 lc
set O	 -g
set AR	 oml
set ARARGS	 a
set RM	 delete
set WILDCARD #?
set LHA	 lha
set LHAFLAGS -axY
set ARCHIVE	 amisox2.lha

;; these are to compile with no 881/2 support
;; your compiler should -DAMIGA itself, but just in case...
set SOX		sox
set SOUNDLIB	libst.lib
set MATHLIB	lib:lcm.lib
set CFLAGS	$O -DAMIGA

;; these are to compile for a 68881/2 on math funcs
;; your compiler should -DAMIGA itself, but just in case...
;set SOX		sox881
;set SOUNDLIB	libst881.lib
;set MATHLIB	 lib:lcm881.lib lib:lcm.lib
;set CFLAGS	 $O -DAMIGA -f8 -DMC68881

;; these are the amiga support files
AMFILES = Makefile.amiga Maker amiga.lha README.amiga sox.cat st.cat

;; start your engines
;;
skip <object>

lab
lab $SOX
$CC $CFLAGS $PSRC
;;;;;;;;;;;;compile & link libst.lib
$CC $CFLAGS $FSRC $ESRC $LIBSOURCES
;$RM $SOUNDLIB       ; Amiga make will choke if libst.lib does not
                     ; exist, so delete it yourself.
$AR $SOUNDLIB $ARARGS $FOBJ $EOBJ $LIBOBJS
;$RANLIB $SOUNDLIB   ; No ranlib on amiga, none needed.
;;;;;;;;;;;;end libst.lib
blink lib:c.o sox.o to $SOX lib $SOUNDLIB $MATHLIB lib:lc.lib lib:amiga.lib
quit

lab $SOUNDLIB
;;;;;;;;;;;;compile & link libst.lib
$CC $CFLAGS $FSRC $ESRC $LIBSOURCES
;$RM $SOUNDLIB       ; Amiga make will choke if libst.lib does not
                     ; exist, so delete it yourself.
$AR $SOUNDLIB $ARARGS $FOBJ $EOBJ $LIBOBJS
;$RANLIB $SOUNDLIB   ; No ranlib on amiga, none needed.
;;;;;;;;;;;;end libst.lib
quit

lab clean
	$RM $WILDCARD.o
quit

lab archive
	$LHA $LHAFLAGS $ARCHIVE $FILES $AMFILES
quit
