
SRCDIR       = .
CC           = /usr/bin/gcc
PREFIX       = /usr
BIN_DIR      = $(PREFIX)/bin
LDLIBS       = -L/usr/lib  -lm
CFLAGS       = -g -O
CPPFLAGS     = -I. -I.  -I/usr/include 
DEFS         = 
PROGS        = powiedz
INSTALL      = /usr/bin/install -c
INSTALL_PROG = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
MESSAGE      = Hello there

.c.o :
	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c -o $@ $< 

all: $(PROGS)

check : all
	./powiedz -W $(MESSAGE)

SAY_OBJS = say.o newstring.o phtoelm.o \
           holmes.o elements.o nsynth.o def_pars.o l2u.o aufile.o \
           getarg.o Revision.o dits.o polytran.o palput.o

powiedz : $(SAY_OBJS) hplay.o 
	$(CC) -o $@ $(LDFLAGS) $(SAY_OBJS) hplay.o $(LDLIBS)

clean:
	rm -f $(PROGS) $(DICTS) *.o tmp.par core *~ *% ~* ,* .e[cks]1


hplay.o : hplay.c proto.h getargs.h hplay.h 

install  : $(PROGS) $(DICTS)
	for f in $(PROGS); do \
	$(INSTALL_PROG) $$f $(BIN_DIR); \
	done


SAY_OBJS = say.o newstring.o phtoelm.o \
           holmes.o elements.o nsynth.o def_pars.o l2u.o aufile.o \
           getarg.o Revision.o dits.o polytran.o palput.o


Revision.o : Revision.c 
aufile.o : aufile.c proto.h getargs.h l2u.h hplay.h file.h 
newstring.o : newstring.c proto.h newstring.h 
def_pars.o : def_pars.c proto.h getargs.h nsynth.h hplay.h pars.def 
elements.o : elements.c elements.h phfeat.h polphones.h elements.plf
getarg.o : getarg.c proto.h getargs.h 
holmes.o : holmes.c proto.h nsynth.h elements.h newstring.h holmes.h phfeat.h getargs.h 
l2u.o : l2u.c 
nsynth.o : nsynth.c proto.h nsynth.h 
phtoelm.o : phtoelm.c proto.h elements.h phfeat.h newstring.h phtoelm.h \
  hplay.h holmes.h nsynth.h polphones.h
say.o : say.c proto.h nsynth.h hplay.h newstring.h holmes.h phtoelm.h \
  getargs.h file.h say.h 
dits.o : dits.c
palput.o : palput.c
polytran.o: polytran.c
