#
# Copyright (c) 1992-93 by Mark Boyns (boyns@sdsu.edu)
# 
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.  This software is provided "as is" without express or
# implied warranty.
# 

#CC=		cc
CC=		gcc
#CC=		acc
CFLAGS=		-O
LDFLAGS=	-L. -lrplay

BIN_DIR=	/usr/local/bin
LIB_DIR=	/usr/local/lib
INCLUDE_DIR=	/usr/local/include

LIBRPLAY_SRCS=	librplay.c
LIBRPLAY_OBJS=	$(LIBRPLAY_SRCS:%.c=%.o)

RPLAYD_SRCS=	rplayd.c libst.c
RPLAYD_OBJS=	$(RPLAYD_SRCS:%.c=%.o)

RPLAY_SRCS=	rplay.c
RPLAY_OBJS=	$(RPLAY_SRCS:%.c=%.o)

all:		librplay.a rplayd rplay

world:		all install

librplay.a:	$(LIBRPLAY_OBJS)
		ar rcv $@ $?
		ranlib $@

rplayd:		$(RPLAYD_OBJS)
		$(CC) $(CFLAGS) -o $@ $(RPLAYD_OBJS) $(LDFLAGS)

rplay:		$(RPLAY_OBJS)
		$(CC) $(CFLAGS) -o $@ $(RPLAY_OBJS) $(LDFLAGS)

install:	librplay.a rplayd rplay
		cp rplayd $(BIN_DIR)
		cp rplay $(BIN_DIR)
		cp rplay.h $(INCLUDE_DIR)
		cp librplay.a $(LIB_DIR)
		ranlib $(LIB_DIR)/librplay.a

shar:
		rm -rf rplay.shar*
		shar -c -o rplay.shar README INSTALL WARNING README.LIBRPLAY Makefile *.h *.c contrib
clean:
		rm -f *.o rplayd rplay librplay.a a.out core
