
#	NetFone: Make file

#   Directory where the Sun sound utilities, including libaudio.a
#   are installed.
SOUND = /home/grouplab/src/sound

#   Directory where the #include files for the Sun sound utilities
#   are installed.
MULTIMEDIA = $(SOUND)/multimedia

#   Internet socket port used by mike and speaker.  If you change this,
#   you will not be able to exchange sound with users who've built
#   NetFone with different values.
INTERNET_PORT = 2074

#   Program name (shar will be $(PROG).shar)
PROG =	netfone

#   Source files distributed in the .shar archive.
SFILES = README Makefile mike.c netfone.1 soundbyte.c speaker.c

#   Special modes, if any, for C compilations.
MODES = -O

CARGS = -I$(MULTIMEDIA) -DInternet_Port=$(INTERNET_PORT)

CFLAGS = $(MODES) $(CARGS)

all:	speaker mike

SPKROBJS = speaker.o soundbyte.o

speaker: $(SPKROBJS)
	cc $(SPKROBJS) $(SOUND)/libaudio.a -lm -o speaker

MIKEOBJS = mike.o soundbyte.o

mike:	$(MIKEOBJS)
	cc $(MIKEOBJS) -lm -o mike

speaker.o: speaker.c

mike.o: mike.c

manpage:
	nroff -man netfone.1 | more

printman:
	ptroff netfone.1 -man

shar:
	shar -b -v $(SFILES) >$(PROG).shar

#   Note: the following LINT line feeds both main programs and the the
#	  subroutine file they share to LINT so  that  it  can	detect
#	  unused functions in the library, soundbyte.c This results in
#	  a harmless warning about the duplicate definition of main().
#	  NetFone  is  *not*  lint-free.   I  cannot  bring  myself to
#	  butcher the source to the extent that would be required.
lint:
	lint $(CARGS) mike.c speaker.c soundbyte.c

spell:
	spell -b netfone.1 | fmt
	spell -b README    | fmt

clean:
	rm -f core *.out *.o *.bak *.shar speaker mike

backup:
	mt -f $(TAPE) rew
	tar cfbv $(TAPE) 126 *
	mt -f $(TAPE) rew
