
# Sound Tools Makefile
# 	builds libst.a and sox
# This makefile assumes Microware Ultra C
#
# NOTE! You have to rename 8svx.c to svx8.c
#
# Boisy G. Pitre (boisy@microware.com)

RDIR	=	RELS
CFLAGS	=	-ai -DOS9 -DNEED_GETOPT	# use strict ANSI mode, shared libraries
LFLAGS	=	$(CFLAGS) -l=/dd/lib/sys_clib.l
CC		=	cc

FSRC	=	raw.c voc.c au.c sf.c aiff.c hcom.c svx8.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
PSRC	=	sox.c

SOURCES	=	$(PSRC) $(FSRC) $(ESRC) handlers.c libst.c misc.c getopt.c
HEADERS	=	st.h libst.h sfheader.h version.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 \
			Makefile.os9 sbprog.doc 
OS968K	=	Makefile.os9
FILES	=	$(MISC) $(HEADERS) $(SOURCES) $(OS968K) $(TESTS)

FOBJ	=	$(RDIR)/raw.r $(RDIR)/voc.r $(RDIR)/au.r $(RDIR)/sf.r \
			$(RDIR)/aiff.r $(RDIR)/hcom.r $(RDIR)/svx8.r $(RDIR)/sndrtool.r \
			$(RDIR)/wav.r $(RDIR)/smp.r $(RDIR)/sbdsp.r $(RDIR)/auto.r \
			$(RDIR)/cdr.r $(RDIR)/dat.r  \
			$(RDIR)/g711.r $(RDIR)/g72x.r $(RDIR)/g721.r $(RDIR)/g723_24.r $(RDIR)/g723_40.r

EOBJ	=	$(RDIR)/copy.r $(RDIR)/avg.r $(RDIR)/pred.r $(RDIR)/stat.r \
			$(RDIR)/vibro.r $(RDIR)/echo.r $(RDIR)/rate.r $(RDIR)/band.r \
			$(RDIR)/lowp.r $(RDIR)/highp.r $(RDIR)/reverse.r

LIBOBJS	=	$(FOBJ) $(EOBJ) $(RDIR)/handlers.r $(RDIR)/libst.r \
			$(RDIR)/misc.r $(RDIR)/getopt.r

all:	sox
	@echo Done

sox:	$(RDIR)/sox.r $(LIBOBJS)
	$(CC) -f=$@ $(RDIR)/sox.r $(LIBOBJS) $(LFLAGS)

sox.r:		sox.c st.h

$(LIBOBJS):	st.h version.h patchlvl.h

# OS-9 systems need the appropriate programs
# to make use of this section.
sox.txt: sox.man st.man
	del sox.txt
	nroff -man sox.man ! col > sox.txt
	nroff -man st.man ! col > st.txt

# Just guessing here
svx8.c: 8svx.c
	@echo Hey! You need to copy 8svx.c to svx8.c
	# what's the cp command?
