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

NAME = MP3Broadcaster
C++ = $(CPLUS)
CC = $(CCOMP)
LINK = $(LINKER)
CCFLAGS += $(COMPILER_FLAGS) $(INCLUDE_FLAG) ../PlatformHeader.h $(INCLUDE_FLAG) ../revision.h -g -Wall
LIBS = $(CORE_LINK_LIBS) -lCommonUtilitiesLib ../CommonUtilitiesLib/libCommonUtilitiesLib.a

#OPTIMIZATION
CCFLAGS += -O3

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

CCFLAGS += -I.
CCFLAGS += -I..
CCFLAGS += -I../QTFileLib
CCFLAGS += -I../OSMemoryLib
CCFLAGS += -I../APIStubLib
CCFLAGS += -I../APICommonCode
CCFLAGS += -I../CommonUtilitiesLib
CCFLAGS += -I../PlaylistBroadcaster.tproj

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

LINKOPTS = -L../CommonUtilitiesLib
LINKOPTS += -L../QTFileLib

C++FLAGS = $(CCFLAGS)

CFILES  = ../CommonUtilitiesLib/daemon.c ../CommonUtilitiesLib/getopt.c

#
#
#
#
CPPFILES = 	BroadcasterMain.cpp \
			MP3Broadcaster.cpp \
			MP3BroadcasterLog.cpp \
			MP3FileBroadcaster.cpp \
			MP3MetaInfoUpdater.cpp \
           	../PlaylistBroadcaster.tproj/NoRepeat.cpp \
           	../PlaylistBroadcaster.tproj/PickerFromFile.cpp\
           	../PlaylistBroadcaster.tproj/PlaylistPicker.cpp\
			../APICommonCode/QTSSRollingLog.cpp \
			../SafeStdLib/InternalStdLib.cpp \
			../OSMemoryLib/OSMemory.cpp

#
#
# CCFLAGS += $(foreach dir,$(HDRS),-I$(dir))

LIBFILES = 	../CommonUtilitiesLib/libCommonUtilitiesLib.a

all: MP3Broadcaster

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

install: MP3Broadcaster

clean:
	rm -f MP3Broadcaster $(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

