#
# Makefile for GSM 06.10
#
# Copyright (C) 2004 Post Increment, All Rights Reserved
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is Open H323 library.
#
# The Initial Developer of the Original Code is Post Increment
#
# Contributor(s): ______________________________________.
#
# $Log: Makefile.in,v $
# Revision 1.6  2007/08/26 09:27:33  dominance
# Large video codecs cleanup by Matthias Schneider (ma30002000 _at_ yahoo.de),
# consisting of:
#
# plugins/common:
#  * Add display calling plugin in debug output
#  * Only check for ffmpeg functions the calling plugin really depends on
# plugins/H.261-vic:
#  * Introduce debug tracing
# plugins/H.263+:
#  * Check for correct codec initialization
#  * Really drop frame if it doesn't contain a picture header
#  * Change description from H.263 to H.263P (p as in plus)
#  * Make use of shared code
# plugins/H.264:
#  * Fix include of x264.h for MPL build
#  * Allow disabling of sending STAP-A packets
# plugins/THEORA:
#  * Make use of shared code
#
# Revision 1.5  2007/04/19 06:09:04  csoutheren
# Fixed plugin build system to use better detection for OSX
# Resolved 1636262 - Fix for audio plugins for OSX
#
# Revision 1.4  2006/10/10 01:42:55  csoutheren
# Applied patches from Ekiga bug 360869 - fix OpenSolaris build problems
# Thanks to Boying Lu
#
# Revision 1.3  2006/08/20 00:32:25  csoutheren
# Added missing files to Makefile
#
# Revision 1.2  2006/08/12 10:59:14  rjongbloed
# Added Linux build for H.261 plug-in.
#

VC_PLUGIN_DIR=@VC_PLUGIN_DIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
target_os=@target_os@

SRCDIR	= ./vic
OBJDIR	= ./obj

BASENAME=h261-vic
SONAME	=$(BASENAME)
COMMONDIR       =../common
PLUGINDIR       =../../

CC	 	=@CC@
CFLAGS	 	=@CFLAGS@
CXX	 	=@CXX@
LDSO	 	=@LDSO@
PLUGINEXT	=@PLUGINEXT@
STDCCFLAGS	=@STDCCFLAGS@
LDFLAGS		=@LDFLAGS@

EXTRACCFLAGS    += -I$(COMMONDIR) -I$(PLUGINDIR)

vpath   %.cxx $(COMMONDIR)
vpath	%.cxx $(SRCDIR)
vpath	%.c   $(SRCDIR)
vpath	%.o   $(OBJDIR)

SRCS	+= h261vic.cxx \
	   $(COMMONDIR)/trace.cxx \
           $(SRCDIR)/encoder-h261.cxx \
	   $(SRCDIR)/transmitter.cxx \
           $(SRCDIR)/vid_coder.cxx \
	   $(SRCDIR)/p64encoder.cxx \
           $(SRCDIR)/p64.cxx \
           $(SRCDIR)/dct.cxx \
           $(SRCDIR)/huffcode.c \
           $(SRCDIR)/bv.c \

$(OBJDIR)/%.o : %.cxx
	@mkdir -p $(OBJDIR) >/dev/null 2>&1
	$(CXX) -I../../../include $(EXTRACCFLAGS) $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) -c $< -o $@

$(OBJDIR)/%.o : %.c
	@mkdir -p $(OBJDIR) >/dev/null 2>&1
	$(CC) -I../../../include $(EXTRACCFLAGS) $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) -c $< -o $@

PLUGIN	= ./$(BASENAME)_video_pwplugin.$(PLUGINEXT)
STATIC	= ./lib$(BASENAME)_video_s.a

OBJECTS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(patsubst %.cxx,%.o,$(notdir $(SRCS)))))

$(PLUGIN): $(OBJECTS)
ifeq (,$(findstring solaris,$(target_os)))
	$(CXX) $(LDSO) -o $@ $^
else	
	$(CXX) $(LDSO) $@ -o $@ $^
endif

install:
	mkdir -p $(DESTDIR)$(libdir)/$(VC_PLUGIN_DIR)
	install $(PLUGIN) $(DESTDIR)$(libdir)/$(VC_PLUGIN_DIR)

uninstall:
	rm -f $(DESTDIR)$(libdir)/$(VC_PLUGIN_DIR)/$(PLUGIN)

clean:
	rm -f $(OBJECTS) $(PLUGIN)

###########################################
