include @RPLAY_TOP@/Makefile.config

srcdir = @srcdir@
VPATH = @srcdir@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS= @srcdir@/../mkinstalldirs

CPPFLAGS=	$(CC_OPTIONS) -I. -I../include -I@srcdir@/../include -I@srcdir@/../lib @DEFS@

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

LDFLAGS=	$(LD_OPTIONS) -L../librplay -lrplay -L../lib -lrp @LDFLAGS@ @LIBS@

TARGET=		rplay
SRCS=		rplay.c
OBJS=		rplay.o

all:		$(TARGET)

$(TARGET):	$(OBJS) ../librplay/$(LIBRPLAY_NAME) ../lib/librp.a
		$(CC) -o $@ $(OBJS) $(LDFLAGS)

../librplay/$(LIBRPLAY_NAME):
		(cd ../librplay; $(MAKE) $(MFLAGS))

../lib/librp.a:
		(cd ../lib; $(MAKE) $(MFLAGS))

install:	all
		$(MKINSTALLDIRS) $(bindir)
		$(INSTALL_PROGRAM) $(TARGET) $(bindir)/$(TARGET)

uninstall:
		$(RM) $(bindir)/$(TARGET)

clean:
		$(RM) $(OBJS) $(TARGET) a.out core *~ *.bak *.orig TAGS

distclean:	clean
		$(RM) Makefile

tags:
		$(TAGS) *.[ch]

TAGS:		tags

etags:		tags

depend:
		$(MAKEDEPEND) -- $(CPPFLAGS) $(CFLAGS) -- $(SRCS)

