#
# Makefile for Common-ISDN API LID plugin
#
# 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.2  2007/09/05 11:52:55  csoutheren
# Fix compilation on MacOSX
#
# Revision 1.1  2006/11/24 09:22:01  rjongbloed
# Added files for CAPI LID on both Windows and Linux. Still much implementationto be done!
#
#

STDCCFLAGS =@STDCCFLAGS@
CXXFLAGS   =@CXXFLAGS@
LID_PLUGIN_DIR=@LID_PLUGIN_DIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@

CC=@CC@
CXX=@CXX@
LDSO=@LDSO@

ifndef PREFIX
PREFIX=/usr/local
endif

SONAME	= capi

OBJDIR	= ./obj

SRCS	+= CAPI.cxx

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

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

PLUGIN	= ./ixj_lid_pwplugin.so

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

$(PLUGIN): $(OBJECTS)
	$(CC) $(LDSO)$(SONAME) -o $@ $^ $(EXTRALIBS)

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

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

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

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