# my_port is the unique port name which identifies this particular server
MY_PORT = \"pssmidi\"

MYOBJS = MIDIDevice.o\
	 MIDISoundDevice.o\
	 Message.o\
	 MessageList.o\
	 HardwareServer.o\
	 InitMessageList.o	


include ../Makefile.defines
include ../Makefile.common

LIBS =


DEVICEDEFAULTS = PSSDeviceDefaults.config
DEVICEPARAMS = PSSDeviceParameters.tab
MESSAGECONFIG = PSSMessageConfiguration.config
SERVERDEVICECLASS = MIDISoundDevice

DEFINES = -DMY_PORT=$(MY_PORT) -DROOT=\"$(SOUNDLIBDIR)\"

DEPEND_OBJS = $(MYOBJS)


SRCDIRS = .:$(COMMON_SUBDIRS)
vpath %.cc $(SRCDIRS)
vpath %.c  $(SRCDIRS)
vpath %.h  .:../../Includes
vpath %.o  ../CommonObjs

C++FLAGS = -O -I. -I../../Includes $(DEFINES)
CFLAGS   = -O -I. -I../../Includes $(DEFINES)
C++ = g++
CC = gcc


default: makedepend pssmidid

pssmidid: $(OBJS) 
	$(C++) $(C++FLAGS) -o $@ $(OBJFILES) $(LIBS)

install:  pssmidid
	install -d $(SOUNDLIBDIR)
	install -s pssmidid $(SOUNDLIBDIR)
	install -d $(SOUNDLIBDIR)
	install -m 0644 $(DEVICEPARAMS) $(DEVICEDEFAULTS) $(MESSAGECONFIG) $(SOUNDLIBDIR)
	install -m 0644 YamahaInstruments $(SOUNDLIBDIR)

InitMessageList.cc: $(DEVICEPARAMS) $(DEVICEDEFAULTS) $(MESSAGECONFIG) 
	$(TOP)/ConfigureDeviceServer $(DEVICEPARAMS) $(DEVICEDEFAULTS) \
	     $(MESSAGECONFIG) $(SERVERDEVICECLASS)

clean:
	rm -f *.o *.BAK *.CKP *~ core *.dep		
	rm -f pssmidid InitMessageList.cc

%.dep: %.cc
	$(C++) $(C++FLAGS) -M $< > $@

%.dep: %.c
	$(CC) $(CFLAGS) -M $< > $@

%.o: %.cc
	DEPENDENCIES_OUTPUT="$*.dep"; export DEPENDENCIES_OUTPUT; \
	$(C++) $(C++FLAGS) -c $<

%.i: %.cc force
	$(C++) $(C++FLAGS) -E $< | sed '/^[ 	]*$$/d' > $@

makedepend:  $(DEPEND_OBJS:.o=.dep)
	cat *.dep > Makefile.depend

include Makefile.depend

force:
