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


#
# Compiler definitions and flags
switch $(OS) {

case FREEBSD :
	CCFLAGS += -g -ansi -Wall ;
	C++FLAGS = $(CCFLAGS) ;
	
case RHAPSODY :
	CC = cc ;
	C++ = c++ ;
	LINK = c++ ;
	MIG = mig ;

	CCFLAGS += -D__MacOSX__ -DNeXT -include TimeSharePrefixMOSX.h -arch ppc -Wall -Wredundant-decls -Wcast-qual -Wno-four-char-constants -fhandle-exceptions -fcommon ;

	FRAMEWORKS = -framework Foundation -framework NIAccess ;

	CCFLAGS += -g ;
	C++FLAGS = $(CCFLAGS) ;
}

#
# Optimization flags
OPTIM = -OO ;


#
# Additional rules
rule UserObject
{
	switch $(>) {
		case *.defs	: MIG $(<) : $(>) ;
		case *		: ECHO "Unknown suffix on" $(>) ;
	}
}

rule MIG
{
	#
	# A lie to get Jam to execute our rule; we don't actually build a .o file.
	DEPENDS $(<) : $(>) ;
	TEMPORARY $(<) ;
	
	#
	# The actual rule
	DEPENDS $(<:S=.h) $(<:B)Server.c $(<:B)User.c : $(<) ;
	Clean clean : $(<:S=.h) $(<:B)Server.c $(<:B)User.c ;
}
actions MIG
{
	$(MIG) $(>) ;
}


#
# Where our headers are located
HDRS = . ;

#
# Our interfaces
DEFS = QTSCRPI.defs ;

#
# Our source files
CFILES = mycondition.c mymutex.c nilib2.c 
		 $(DEFS:B)Server.c ;
CPPFILES = MyAssert.cpp Dictionary.cpp Exception.cpp IdleTask.cpp
           main.cpp OS.cpp OSCond.cpp OSFileSource.cpp OSHeap.cpp
           OSMutex.cpp OSQueue.cpp OSRef.cpp OSThread.cpp
           ReflectorSession.cpp RTCPAPPPacket.cpp
	   RTPAccessLogModule.cpp FilePrefsSource.cpp NetInfoPrefsSource.cpp
           RTCPDebugModule.cpp RTCPPacket.cpp RTCPRemoteStatusModule.cpp
           RTPFileModule.cpp RTPInterfaceModule.cpp RTPModule.cpp
           RTPReflectorModule.cpp RTPServer.cpp RTPServerInterface.cpp
           RTPSession.cpp RTPStream.cpp StreamDictionary.cpp
           RTSPLoggingModule.cpp RTSPMessages.cpp RTSPModule.cpp
           RTSPPrefs.cpp RTSPProtocol.cpp RTSPRequest.cpp
           RTSPRequestInterface.cpp RTSPRequestStream.cpp
           RTSPRollingLog.cpp RTSPServer.cpp RTSPServerInterface.cpp
           RTSPSession.cpp RTSPSessionInterface.cpp
           RTSPSvrControlModule.cpp RTSPTestModule.cpp RTSPPlayListModule.cpp
           RTSPWebDebugModule.cpp RTSPWebStatsModule.cpp SDPParser.cpp
           SessionDictionary.cpp Socket.cpp StringFormatter.cpp
           StringParser.cpp StringTranslator.cpp StrPtrLen.cpp Task.cpp
           TCPListenerSocket.cpp TCPSocket.cpp TimeoutTask.cpp
           UDPDemuxer.cpp UDPSocket.cpp UDPSocketPool.cpp 
	   RTCPFlowControlModule.cpp SocketUtils.cpp ;

#
# Our libraries
LIBS = atomic QTRTPFile ;


#
# Build all of the objects
Objects $(DEFS) $(CFILES) $(CPPFILES) ;

#
# Link the QuickTimeStreamingServer
MainFromObjects QuickTimeStreamingServer : $(CFILES:S=.o) $(CPPFILES:S=.o) ;
LinkLibraries QuickTimeStreamingServer : lib$(LIBS) ;
LINKFLAGS on QuickTimeStreamingServer += $(FRAMEWORKS) ;
