#
#  This material contains proprietary software of Entropic Speech, Inc.
#  Any reproduction, distribution, or publication without the prior
#  written permission of Entropic Speech, Inc. is strictly prohibited.
#  Any public distribution of copies of this work authorized in writing by
#  Entropic Speech, Inc. must bear the notice
#
#      "Copyright (c) 1988 Entropic Speech, Inc. All rights reserved."
#
#  makefile for dspsgram
#  @(#)makefile	1.6	6/18/91	ESI
#

DSP32INC = -I../dsp32/lib 
SPECT_PROG = -DSPECT_PROG=\"$(SPSDIR)/32bin/dspgm\" \
	-DSPECT_PROG_32C=\"$(SPSDIR)/32cbin/dspgm\"
CFLAGS =  -g $(PROGCFLAGS) $(DSP32INC) $(SPECT_PROG) -I../waves/src/h -I../dsp32/inc
LFLAGS = $(LINTFLAGS) $(SPECT_PROG) -I../waves/src/h

OBJS = dspsgram.o ddutils.o
SRCS = dspsgram.c ddutils.c
PROGNAME = dspsgram
MANNAME = dspsgram.1
PARAM = Pdspsgram


$(PROGNAME): $(WSPSLIB) $(WAVESDIR)/libds.a $(OBJS) $(LIBDIR)/$(WHDRLIB)
	$(CC)  $(CFLAGS) $(OBJS) $(WAVESDIR)/libds.a \
	$(LIBDIR)/$(WHDRLIB) $(WSPSLIB) -lm -o $(PROGNAME)

$(OBJS): $(SINC)/esps.h $(SINC)/unix.h $(SINC)/limits.h $(SINC)/sd.h \
	$(SINC)/fea.h $(SINC)/window.h $(SINC)/feaspec.h

install: $(PROGNAME)
	$(STRIP) $(PROGNAME)
	-mv -f $(BINDIR)/$(PROGNAME) $(OLDBIN)/$(PROGNAME)
	-chmod $(PROGMOD) $(OLDBIN)/$(PROGNAME)
	mv -f $(PROGNAME) $(BINDIR)/$(PROGNAME)
	chmod $(PROGMOD) $(BINDIR)/$(PROGNAME)
	-diffmk $(MANDIR)/man1/$(MANNAME) $(MANNAME) man.diff
	@echo diffmked man page left in man.diff
	-rm -f $(MANDIR)/man1/$(MANNAME)
	cp $(MANNAME) $(MANDIR)/man1/$(MANNAME)
	chmod $(MANMOD) $(MANDIR)/man1/$(MANNAME)

	-rm -f $(PARAMDIR)/$(PARAM)
	cp $(PARAM) $(PARAMDIR)/$(PARAM)
	chmod $(LIBMOD) $(PARAMDIR)/$(PARAM)

clean:	
	-rm -f $(OBJS) $(PROGNAME)  lint
	
lint:	$(SRCS) 
	$(LINT) $(LFLAGS) $(DSP32INC) $(SRCS) $(LINTLIB) -lm > lint

test:	$(PROGNAME)
	-sh $(PROGNAME).test
