# Makefile for mp
# Greg Lee, 4/8/93

DESTDIR = /usr/src/Sound/bin
LINK = cc

# Two defines in gusvoice.c might have to be changed:
#
#		#define GUSMEMAVAIL (256*1024)
#		#define GUSPATDIR "/dos/ultrasnd/midi"
# or use compiler flags.

# The value of XSELECT determines which channels get sent
# to the external midi port.  If b0 is 1, e.g., channel one
# gets sent there.  I have it as -DXSELECT=0x0ff to send the
# first eight channels out and play only the high eight channels
# on the sound card.  If you don't have an external port, you could
# put -DXSELECT=0.  Similarly, -DPSELECT determines which channels
# should be considered percussion channels; -DPSELECT marks
# channels 10 and 16 for percussion.
# -DK1 is for hooking up and external Kawai K1 -- the relevant code
# is in file phase2.c
# If the synth hooked to the external port has a small number of polyphonic
# voices, you can try adding -DXPOLYPHANY=8 or some other small number,
# in which case mp will disable external output to one or more channels
# if it thinks the limit you set will be exceeded (but I haven't been
# very succesful with this).

CFLAGS = -O2 -DUNIX -DXSELECT=0xffff -DPSELECT=0x8200 \
	-DMIDIIN -DXVOICE -DSBDIR=\"/etc\"

SHROBJ = cardinit.o phase2.o allphase.o gusvoice.o userio.o cmdline.o midifile.o
ADOBJ = ad.o phase1.o adaspace.o $(SHROBJ)
MPOBJ =	mp.o $(SHROBJ)

all:	mp


mp:	$(MPOBJ)
	$(LINK) $(MPOBJ) -o mp

setsb:	setsb.o
	$(LINK) setsb.o -o setsb

seto3:	seto3.o
	$(LINK) seto3.o -o seto3

install: all
	install -s mp $(DESTDIR)

clean:
	rm -f *.o

phase2.o: cext.h adagio.h userio.h cmdline.h pitch.h midicode.h midi.h drum.h allphase.h
cardinit.o: allphase.h
userio.o: cext.h userio.h
cmdline.o: cext.h cmdline.h
allphase.o: cext.h allphase.h
mp.o: cext.h adagio.h midifile.h midi.h midicode.h vname.h allphase.h
gusvoice.o: allphase.h gusvoice.h
