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 @DEFS@
LDFLAGS=	$(LD_OPTIONS) -shared @LDFLAGS@

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

.SUFFIXES: .lo
.c.lo:
		$(CC) -c -fPIC $(CPPFLAGS) $(CFLAGS) -o $@ $<

TARGET=		$(LIBRPLAY_NAME)
SRCS=		rplay.c rptp.c async.c
OBJS=		rplay.o rptp.o async.o
SHAREDOBJS=	rplay.lo rptp.lo async.lo

all:		$(TARGET) librplay.so

#
# Use the following for SunOS 4.1.x, Solaris 2.x, Linux, NetBSD
#
$(TARGET):	$(OBJS)
		$(AR) rcv $@ $?
		$(RANLIB) $@

librplay.so:	$(SHAREDOBJS)
		$(CC) -o $@ $(SHAREDOBJS) $(LDFLAGS)

#
# For HP-UX comment above and uncomment below.
#
#CFLAGS=	+z
#
#$(TARGET):	$(OBJS)
#		ld -b -s +FPD -o $@ $(OBJS)
#		-$(MKINSTALLDIRS) $(libdir)
#		-$(INSTALL) $@ $(libdir)
#		-chmod a+rx $(libdir) $(libdir)/$@
#

install:	all
		$(MKINSTALLDIRS) $(libdir)
		$(INSTALL_DATA) $(TARGET) $(libdir)
		$(INSTALL_DATA) librplay.so $(libdir)

uninstall:
		$(RM) $(libdir)/$(TARGET)
		$(RM) $(libdir)/librplay.so

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

distclean:	clean
		$(RM) Makefile

tags:
		$(TAGS) *.[ch]

TAGS:		tags

etags:		tags

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

