# /***********************************************************
# Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
# Amsterdam, The Netherlands.
# 
#                         All Rights Reserved
# 
# 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, and that the names of Stichting Mathematisch
# Centrum or CWI not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior permission.
# 
# STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
# FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# 
# ******************************************************************/


default:
		@echo 'You must use "make sun4.0", "make sun4.1",'
		@echo '"make next", "make sgi", "make hpux", "make linux"'
		@echo '"make lofi" or "make audiofile"'
		exit 1

all:		radio broadcast

# Platform-specific entries

linux:		# For Linux v1.00
		make all CC=gcc CFLAGS='-DUSE_LINUX'

sun4.0:		# For SunOS 4.x
		make all LIBS=-lX11

sun4.1:		# For SunOS 4.1 with audio library (/usr/demo/SOUND)
		make all LIBS='-lX11 /usr/demo/SOUND/libaudio.a' \
			CFLAGS='-DREMHDR -I/usr/demo/SOUND'

sun4.1.2:	# For SunOS 4.1 with multicast & audio library (/usr/demo/SOUND)
		make all LIBS='-lX11 /usr/demo/SOUND/libaudio.a' \
			CFLAGS='-DHAVE_MCAST -DREMHDR -I/usr/demo/SOUND -DDEFMCAST=\"radio.multicast\"'

sgi:		# For SGI IRIX 4.0
		make all recordulaw recordlinear playulaw \
		CFLAGS='-O' LIBS='-lX11 -laudio'

next:		# NeXT 2.1
		make all sndulaw

hpux:		# HPUX 8.07
		make all 'LIBS=-lX11' \
			CC="cc -Aa" \
			CFLAGS="-D_HPUX_SOURCE +e -I/usr/include/X11R4"

# If you are using the AAPI (Audio Application Programming Interface),
# use the next 3 lines instead and don't forget to edit radio.h.

#hpux:		# HPUX 8.07
#		make all 'LIBS=-lX11' \
#			CC="cc -Aa" \
#	CFLAGS="-D_HPUX_SOURCE +e -I/usr/include/Motif1.1 -I/usr/include/X11R4"

# Where are the (mini) LoFi include files and libraries?
LOFI=		./LoFiLib
LOFIINCLUDE=	-I$(LOFI)
LOFILIBDIRS=	-L$(LOFI)

lofi:
		make all CFLAGS="-g -Ddec_lofi $(LOFIINCLUDE)" \
			LIBS="$(LOFILIBDIRS) -lminilofi -lm"

# Where are the AF include files and libraries?
AF=		/ufs/guido/src/af/AF
AFINCLUDE=	-I$(AF)/include -I$(AF)
AFLIBDIRS=	-L$(AF)/lib/AF -L$(AF)/lib/AFUtil

audiofile:		
		make all CFLAGS="-g -Daudiofile $(AFINCLUDE)" \
		LIBS="$(AFLIBDIRS) -lAF -lAFUtil -lm"


# Common programs:

ROBJ=	 	radio.o socklib.o ulawadpcm.o adpcm.o libst.o
BOBJ=		broadcast.o socklib.o adpcm.o ulawadpcm.o libst.o

radio:		$(ROBJ)
		$(CC) $(ROBJ) $(LIBS) -o radio

broadcast:	$(BOBJ)
		$(CC) $(BOBJ) $(LIBS) -o broadcast

# NeXT-only programs:

sndulaw:	sndulaw.o
		$(CC) sndulaw.o -o sndulaw

# SGI-only programs:

recordulaw:	recordulaw.o libst.o
		$(CC) recordulaw.o -laudio -o recordulaw

recordlinear:	recordlinear.o
		$(CC) recordlinear.o -laudio -o recordlinear

playulaw:	playulaw.o
		$(CC) playulaw.o -laudio -o playulaw

# Service entries:

clean:
		-rm -f core *.o *~ @* '#'* ,* *.pyc *.BAK Part??

clobber:	clean
		-rm -f radio broadcast recordulaw recordlinear playulaw sndulaw

# Dependencies:

broadcast.o:	radio.h adpcm.h
radio.o:	radio.h adpcm.h libst.h
ulawadpcm.o:	adpcm.h libst.h
playulaw.o:	libst.h
