
# Sound Tools Makefile builds sox

FSRC= raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c \
	smp.c sbdsp.c auto.c cdr.c dat.c \
	g711.c g72x.c g721.c g723_24.c g723_40.c

ESRC= copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c \
	highp.c reverse.c dyn.c
PSRC= sox.c

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

HEADERS   = st.h libst.h sfheader.h patchlvl.h wav.h g72x.h

TESTS     = tests.sh testall.sh monkey.au monkey.voc

MISC      = README INSTALL TODO TIPS CHEAT sox.man sox.txt st.man \
	    Makefile.unx Makefile.bor Makefile.b30 Makefile.c70 \
	    sbprog.doc voc.info makefile.st

SKEL	  = skel.c skeleff.c

VMS       = descrip.mms sound2au.com sound2sun.c sound2sun.opt \
	    sox.opt tests.com vms.lis

OS2	  = MakeOS2 MakeOS2.dep

OS9	  = Makefile.os9

AMIGA	  = Makefile.ami amiga.c amiga.h

FILES     = $(MISC) $(HEADERS) $(SOURCES) $(VMS) $(AMIGA) $(OS2) $(OS9) \
		$(SKEL) $(TESTS)

FOBJ= raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o \
	smp.o sbdsp.o auto.o cdr.o dat.o \
	g711.o g72x.o g721.o g723_24.o g723_40.o

EOBJ= copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o \
	highp.o reverse.o dyn.o

LIBOBJS   = $(FOBJ) $(EOBJ) handlers.o libst.o misc.o getopt.o

#
# System dependency parameters
# 	not many, we don't mess with devices
#
# include -DSYSV for AT&T Unix System V

# SHELL	  = /bin/sh	# You may need this.

# define -DNEED_GETOPT to use the enclosed getopt() library.
# To use the system getopt() and getopt.h, don't define NEED_GETOPT

# define -DBLASTER to use the Sound Blaster device driver
# on a 386 AT&T Unix with it installed

# define -DSBLAST to use Steve Haenichen's SBLAST
# driver on any BSD-derived Unix for 386/486 PC's
# BSDI's BSD386, Jolitz 386BSD, or Mt Xinu's Mach-386

# define -DDOS  to compile on PC

# define -DDOS_SND
# defines .snd to mean a DOS soundtool file (starts with SOUND)

# define -NeXT_SND
# defines .snd to mean a NeXT sound format file
#  	only knows a few real sound formats.

# define -DMAC_SND
# defines .snd to mean a Mac-style headerless unsigned byte
#  	sample, probably at 11050 hertz.  You'll have to set 
#	the speed on the command line.

O=-O2		# optimization flags

# Atari GCC

CFLAGS    = $O -DNEED_GETOPT -DDOS -DMAC_SND
CC        = gcc -ansi 
AR        = ar r
RANLIB    = ranlib

all: sox

sox: sox.o $(LIBOBJS)
	$(CC) $(CFLAGS) -o sox.ttp sox.o $(LIBOBJS) -lpml
	xstrip sox.ttp

sox.o:		sox.c st.h

$(LIBOBJS):	st.h
