# Copyright (c) 1999 Apple Computer, Inc.  All rights reserved.
#  

NAME = DarwinStreamingServer
C++ = $(CPLUS)
CC = $(CCOMP)
LINK = $(LINKER)
CCFLAGS += $(COMPILER_FLAGS)  -DDSS_USE_API_CALLBACKS -g -Wall -Wno-format-y2k $(INCLUDE_FLAG) PlatformHeader.h
LIBS = $(CORE_LINK_LIBS) -lCommonUtilitiesLib -lQTFileLib

# OPTIMIZATION
CCFLAGS += -O3

# EACH DIRECTORY WITH HEADERS MUST BE APPENDED IN THIS MANNER TO THE CCFLAGS

CCFLAGS += -I.
CCFLAGS += -IQTFileLib
CCFLAGS += -IOSMemoryLib
CCFLAGS += -IRTSPClientLib
CCFLAGS += -IAPIModules
CCFLAGS += -IAPICommonCode
CCFLAGS += -IAPIModules/OSMemory_Modules
CCFLAGS += -IAPIModules/QTSSAccessLogModule
CCFLAGS += -IAPIModules/QTSSFileModule
CCFLAGS += -IAPIModules/QTSSFlowControlModule
CCFLAGS += -IAPIModules/QTSSReflectorModule
CCFLAGS += -IAPIModules/QTSSSvrControlModule
CCFLAGS += -IAPIModules/QTSSWebDebugModule
CCFLAGS += -IAPIModules/QTSSWebStatsModule
CCFLAGS += -IAPIModules/QTSSAuthorizeModule
CCFLAGS += -IAPIModules/QTSSPOSIXFileSysModule
CCFLAGS += -IAPIModules/QTSSAdminModule
CCFLAGS += -IAPIModules/QTSSMP3StreamingModule
CCFLAGS += -IAPIModules/QTSSRTPFileModule
CCFLAGS += -IAPIModules/QTSSAccessModule
CCFLAGS += -IAPIModules/QTSSHttpFileModule
CCFLAGS += -IQTFileTools/RTPFileGen.tproj
CCFLAGS += -IAPIStubLib
CCFLAGS += -ICommonUtilitiesLib
CCFLAGS += -IRTCPUtilitiesLib
CCFLAGS += -IHTTPUtilitiesLib
CCFLAGS += -IRTPMetaInfoLib
CCFLAGS += -IPrefsSourceLib
CCFLAGS += -IServer.tproj

# EACH DIRECTORY WITH A STATIC LIBRARY MUST BE APPENDED IN THIS MANNER TO THE LINKOPTS

LINKOPTS = -LCommonUtilitiesLib
LINKOPTS += -LQTFileLib

C++FLAGS = $(CCFLAGS)

CFILES = CommonUtilitiesLib/daemon.c

CPPFILES = 	Server.tproj/QTSSExpirationDate.cpp\
			Server.tproj/QTSSCallbacks.cpp \
			Server.tproj/QTSSDictionary.cpp\
			Server.tproj/QTSSDataConverter.cpp \
			Server.tproj/QTSSErrorLogModule.cpp \
			Server.tproj/QTSSMessages.cpp\
			Server.tproj/QTSSModule.cpp \
			Server.tproj/QTSServerPrefs.cpp\
			Server.tproj/QTSSSocket.cpp\
			Server.tproj/QTSSFile.cpp\
			Server.tproj/QTSSPrefs.cpp \
			Server.tproj/QTSServer.cpp\
			Server.tproj/QTSServerInterface.cpp \
			Server.tproj/RTCPTask.cpp\
			Server.tproj/RTPSession.cpp \
			Server.tproj/RTPPacketResender.cpp \
			Server.tproj/RTPBandwidthTracker.cpp \
			Server.tproj/RTPOverbufferWindow.cpp \
			Server.tproj/RTPSessionInterface.cpp\
			Server.tproj/RTPStream.cpp \
			Server.tproj/RTSPProtocol.cpp\
			Server.tproj/RTSPRequest.cpp \
			Server.tproj/RTSPRequestInterface.cpp\
			Server.tproj/RTSPRequestStream.cpp \
			Server.tproj/RTSPResponseStream.cpp\
			Server.tproj/RTSPSession.cpp \
			Server.tproj/RTSPSessionInterface.cpp\
			Server.tproj/main.cpp \
			Server.tproj/RunServer.cpp \
			Server.tproj/GenerateXMLPrefs.cpp \
			Server.tproj/QTSSUserProfile.cpp\
			PrefsSourceLib/FilePrefsSource.cpp\
			PrefsSourceLib/XMLPrefsParser.cpp \
			PrefsSourceLib/XMLParser.cpp \
			OSMemoryLib/OSMemory.cpp \
			RTSPClientLib/RTSPClient.cpp \
			RTSPClientLib/ClientSocket.cpp \
			HTTPUtilitiesLib/HTTPProtocol.cpp \
			HTTPUtilitiesLib/HTTPRequest.cpp \
			RTCPUtilitiesLib/RTCPAPPPacket.cpp\
			RTCPUtilitiesLib/RTCPPacket.cpp \
			RTCPUtilitiesLib/RTCPSRPacket.cpp\
			RTCPUtilitiesLib/RTCPAckPacket.cpp\
			RTPMetaInfoLib/RTPMetaInfoPacket.cpp\
			APIStubLib/QTSS_Private.cpp \
			APICommonCode/QTSSModuleUtils.cpp\
			APICommonCode/QTSSRollingLog.cpp \
			APICommonCode/SDPSourceInfo.cpp \
			APICommonCode/SourceInfo.cpp \
			APICommonCode/QTAccessFile.cpp \
			SafeStdLib/InternalStdLib.cpp \
			APIModules/QTSSAccessLogModule/QTSSAccessLogModule.cpp \
			APIModules/QTSSFileModule/QTSSFileModule.cpp \
			APIModules/QTSSFlowControlModule/QTSSFlowControlModule.cpp \
			APIModules/QTSSReflectorModule/QTSSReflectorModule.cpp \
			APIModules/QTSSReflectorModule/QTSSRelayModule.cpp \
			APIModules/QTSSReflectorModule/ReflectorSession.cpp\
			APIModules/QTSSReflectorModule/RelaySession.cpp\
			APIModules/QTSSReflectorModule/ReflectorStream.cpp\
			APIModules/QTSSReflectorModule/RCFSourceInfo.cpp \
			APIModules/QTSSReflectorModule/RTSPSourceInfo.cpp \
			APIModules/QTSSReflectorModule/RelayOutput.cpp \
			APIModules/QTSSReflectorModule/RelaySDPSourceInfo.cpp \
			APIModules/QTSSReflectorModule/RTPSessionOutput.cpp \
			APIModules/QTSSReflectorModule/SequenceNumberMap.cpp \
			APIModules/QTSSWebDebugModule/QTSSWebDebugModule.cpp \
			APIModules/QTSSWebStatsModule/QTSSWebStatsModule.cpp \
			APIModules/QTSSPOSIXFileSysModule/QTSSPosixFileSysModule.cpp \
			APIModules/QTSSAdminModule/AdminElementNode.cpp \
			APIModules/QTSSAdminModule/AdminQuery.cpp \
			APIModules/QTSSAdminModule/QTSSAdminModule.cpp \
			APIModules/QTSSMP3StreamingModule/QTSSMP3StreamingModule.cpp \
			APIModules/QTSSRTPFileModule/QTSSRTPFileModule.cpp \
			APIModules/QTSSRTPFileModule/RTPFileSession.cpp \
			APIModules/QTSSAccessModule/QTSSAccessModule.cpp \
			APIModules/QTSSHttpFileModule/QTSSHttpFileModule.cpp \
			APIModules/QTSSAccessModule/AccessChecker.cpp
			
# CCFLAGS += $(foreach dir,$(HDRS),-I$(dir))

LIBFILES = 	QTFileLib/libQTFileLib.a \
			CommonUtilitiesLib/libCommonUtilitiesLib.a

all: DarwinStreamingServer

DarwinStreamingServer: $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)  $(LIBFILES)
	$(LINK) -o $@ $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) $(COMPILER_FLAGS) $(LINKOPTS) $(LIBS) 

install: DarwinStreamingServer

clean:
	rm -f $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)

.SUFFIXES: .cpp .c .o

.cpp.o:
	$(C++) -c -o $*.o $(DEFINES) $(C++FLAGS) $*.cpp

.c.o:
	$(CC) -c -o $*.o $(DEFINES) $(CCFLAGS) $*.c

