# Sound Tools Makefile
# 	builds libst.a and sox
# Contributed by: Frank Gadegast <phade@cs.tu-berlin.de>

SUFFIXES = .c .obj .a

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
PSRC= sox.c

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

LIBOBJS   = $(FOBJ) $(EOBJ) handlers.o libst.o misc.o getopt.o
SOUNDLIB  = 
FOBJ= raw.obj voc.obj au.obj sf.obj aiff.obj hcom.obj 8svx.obj \
	sndrtool.obj wav.obj smp.obj sbdsp.obj auto.obj cdr.obj dat.obj \
	g711.obj g72x.obj g721.obj g723_24.obj g723_40.obj

EOBJ= copy.obj avg.obj pred.obj stat.obj vibro.obj echo.obj rate.obj \
	band.obj lowp.obj highp.obj reverse.obj
LIBOBJS   = $(FOBJ) $(EOBJ) handlers.obj libst.obj misc.obj getopt.obj
SOUNDLIB = libst

CFLAGS    = -DDOS -D__STDC__=1	
CC        = cl

TLIB	  = lib

.c.obj:
	$(CC) $(CFLAGS) -c -O $*.c
	$(TLIB) $(SOUNDLIB) +$*,,

all: sox

sox: sox.obj $(SOUNDLIB)
	$(CC) $(CFLAGS) sox.obj $(SOUNDLIB).lib 

$(SOUNDLIB): $(LIBOBJS)

sox.obj:		sox.c st.h
	$(CC) $(CFLAGS) -c -O $*.c

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

clean:
	rm -f *.o
	rm -f *.raw
	rm -f *.sf
	rm -f core
