#
# Pablo System: Visual/Src/Audio/Build/NetworkAudioAccessDaemon/Makefile
#
.PHONY : Makefile ../Makefile.common

# my_port is the port where hte network audio access daemon runs
MY_PORT    := \"naad\"

EXECUTABLE := naad

AUDIO_TOP  := ../..
#
# In setting the local definitions, be careful to use the recursive form
# (VAR = VALUE) for all variables that depend on information from the 
# confguration file Makefile.defines in their definition because that isn't
# include until later (by ../Makefile.common).
#
LOCAL_DEVICE_FILE = \"$(SOUNDDIR)/config/LocalSoundHardware\"

INCLUDES    := -I. \
	       -I$(AUDIO_TOP)/Includes \
	       -I$(AUDIO_TOP)/NetworkAudioAccessDaemon

SRCDIRS     := . \
	       $(AUDIO_TOP)/Shared \
	       $(AUDIO_TOP)/CommonClasses \
	       $(AUDIO_TOP)/NetworkAudioAccessDaemon

LOCAL_FLAGS  = -DMY_PORT=$(MY_PORT) \
	       -DNETROOT=$(ROOT_TMP) \
	       -DLOCAL_DEVICE_FILE=$(LOCAL_DEVICE_FILE)

COMMON_OBJS := $(addprefix ../CommonObjs/,$(shell cat ../CommonObjs/CommonObjs))

OBJECTS     := LocalSoundServer.o \
	       Message.o \
	       MessageList.o 

TARGET	    := $(EXECUTABLE)

include ../Makefile.common

#
# Targets
#
.PHONY : install

$(EXECUTABLE): $(OBJECTS) $(COMMON_OBJS)
	$(C++) $(C++FLAGS) $(CNFG_C++LDFLAGS) -o $@ $(OBJECTS) $(COMMON_OBJS)

$(COMMON_OBJS):
	$(MAKE) -C ../CommonObjs

install:  $(EXECUTABLE)
	$(MAKEDIRHIER) $(SOUNDLIBDIR)
	install -s -m 0755 $(EXECUTABLE) $(SOUNDLIBDIR)
	$(MAKEDIRHIER) $(SOUNDDIR)/config
	install -c $(AUDIO_TOP)/config/LocalSoundHardware $(SOUNDDIR)/config

	rm -f *.o *.BAK *.CKP *~ core *.dep Makefile.depend
	rm -f naad
