
## Sound Tools Makefile for AMIGA
## 	builds libst.lib and sox
##
## Rename this to "lmkfile" for SAS/lmk, "dmakefile" for DICE/dmake
##
## To make both FPU and non-FPU versions, 
##	1) "make sox" (or "make")
##	2) delete '#' characters in lines 59-62 of this file
##	3) "make sox881" (or "make")

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

SOURCES   = $(PSRC) $(FSRC) $(ESRC) handlers.c libst.c misc.c getopt.c

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

TESTS     = tests.sh monkey.au monkey.voc

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

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

FILES     = $(MISC) $(HEADERS) $(SOURCES) $(SKEL) $(TESTS)

## sbdsp.c is a driver for the IBMoid SoundBlaster gadget...not compiled for Amiga
FOBJ= amiga.o raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o #sbdsp.o
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
LIBOBJS   = $(FOBJ) $(EOBJ) handlers.o libst.o misc.o getopt.o

##
## System dependency parameters
##
## 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.
##
CC	= lc
O	= -g
AR	= oml
AR_ARGS	= a
RM	= delete
WILDCARD= *
LHA	= lha
LHAFLAGS= -arxY
ARCHIVE	= amisox2.lha

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

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

## these are the amiga support files
AMFILES = Makefile.amiga Amiga.lha README.amiga sox.cat st.cat

## start your engines
##
all: $(SOX)

$(SOX): sox.o $(SOUNDLIB)
	blink lib:c.o sox.o to $(SOX) lib $(SOUNDLIB) $(MATHLIB) lib:lc.lib lib:amiga.lib

$(SOUNDLIB): $(LIBOBJS)
#	$(RM) $(SOUNDLIB)       # Amiga make will choke if libst.lib does not
                                # exist, so delete it yourself.
	$(AR) $(SOUNDLIB) $(AR_ARGS) $(LIBOBJS)
#	$(RANLIB) $(SOUNDLIB)   # No ranlib on amiga (except amiga gcc); $(AR) should handle this

sox.o:		sox.c st.h

## SAS's lmk hates this -- tries to compile st.c
#$(LIBOBJS):	st.h

clean:
	$(RM) $(WILDCARD).o

archive:
	$(LHA) $(LHAFLAGS) $(ARCHIVE) $(FILES) $(AMFILES)
