# Select your audio output device.  Current choices are:
#   Sun:   Sun workstation with audio hardware.
#   HP:    HP9000s700 with audio hardware.
#   X11:   The X11 window system.
# Adding a new device is as simple as creating a new implementation of the
# beep.h interface.  See beep*.c for examples.  Please send any additions
# to the authors.
#
#DEVICE = Sun
#DEVICE = HP
DEVICE = X11

# For termio a la System V, add -DUSG to DEFINES.
# For alternate random number generator, add either -DUSELRAND for lrand48(),
#   or -DUSERAND for (ugh) rand(). Default is -DUSERANDOM for random().
# Define SIGRET to be your signal handler return type if not "void".
# Define BSDSIGS or POSIXSIGS, depending on what kind of signals you
#   have. "Old-style" signals are not currently supported. Default is BSDSIGS.
#
#DEFINES = -DUSG -DUSELRAND -DPOSIXSIGS
DEFINES = -DFULLVOLUME -DUSG

# The flags necessary to link with the X11 libraries.
#X11LIBS = -L/usr/X386/lib -lX11 -lsocket -lnsl
X11LIBS = -lX11 -L/usr/X11R6/lib

# Your favorite C compiler
CC	= gcc
#CC	= cc

# The flags your favorite C compiler requires to work.
#CFLAGS  = -O -I/usr/X386/include -DSVR4 -DSYSV386 ${DEFINES}
CFLAGS  = -O2 -m486 -I/usr/X11R6/include ${DEFINES}

all:	morse QSO

morse:	morse${DEVICE}
	rm -f $@
	ln morse${DEVICE} $@

morseSun:	morse.o beepSun.o
	$(CC) -o $@ morse.o beepSun.o -L/usr/demo/SOUND -laudio -lm

morseHP:	morse.o beepHP.o alarm.o
	$(CC) -o $@ morse.o beepHP.o alarm.o -lm

morseX11:	morse.o beepX11.o alarm.o
	$(CC) -o $@ morse.o beepX11.o alarm.o $(X11LIBS)

QSO:	QSO.o
	$(CC) -o $@ QSO.o

test:
	./QSO | ./morse -l -e

clean:
	rm -f *.o morseSun morseHP morseX11

squeakyclean:	clean
	rm -f morse QSO


morse.o:	beep.h
beepSun.o:	beep.h
beepHP.o:	beep.h alarm.h
beepX11.o:	beep.h alarm.h
alarm.o:	alarm.h
