# ::::::::::::::
# library/Makefile
# ::::::::::::::

NAME = libSms.a

#
# Source files for this library 
#
MFILES = SmsObject.m
HFILES = SmsObject.h
CFILES = sineSynth.c sinTab.c variousFunctions.c \
peakDetection.c harmDetection.c peakContinuation.c spectrum.c \
realft.c covLatticeHarm.c windows.c stocAnalysis.c smsIO.c filters.c \
fixTrajectories.c smsSynthesis.c smsAnalysis.c spectralApprox.c \
getResidual.c interpolateArrays.c interpolateSms.c filterArray.c sincTab.c

NIBFILES =
TIFFFILES = 
PSWFILES = 
#
# Libraries used by this application.
#
LIBS =-lsys_s -lm

#
# Flags to pass on to the compiler and linker.
#

LDFLAGS =

#
# Rules.
#
SRCFILES = $(MFILES) $(HFILES) $(CFILES) $(NIBFILES) $(TIFFFILES) $(PSWFILES)
OBJFILES =  $(CFILES:.c=.o) $(MFILES:.m=.o) $(PSWFILES:.psw=.o) 
DERIVED = $(PSWFILES:.psw=.c) 
GARBAGE = $(DERIVED) core errs 
INSTALLDIR = ../bin
INSTALLFLAGS = -c -s -m 755
SRCROOT = /dist/sound_music/sms/library
HDR_DIR = ..

CFLAGS=	-Wall -g -DEBUG $(RC_CFLAGS)

$(NAME): $(OBJFILES) 
	ar qv $(NAME) $(OBJFILES)
	ranlib $(NAME)

all: $(NAME)

lean:
	/bin/rm -f *.o

clean: lean
	/bin/rm -f $(NAME)

help: 
	@echo '  make $(NAME) - to make the application'
	@echo '  make clean -    to remove all files but the source'
	@echo '  make install [DSTROOT=somepath] - to make and install the application'

installsrc:
	-rm -rf $(SRCROOT)
	mkdirs -m 755 $(SRCROOT)
	cp $(SRCFILES) Makefile README $(SRCROOT)
	chmod 444 $(SRCROOT)/*

install: $(DSTROOT)$(INSTALLDIR) all
	cp -p $(NAME) $(DSTROOT)$(INSTALLDIR)
	ranlib $(INSTALLDIR)/$(NAME)

$(DSTROOT)$(INSTALLDIR):
	mkdirs $(DSTROOT)$(INSTALLDIR)
