# Copyright 1990-2001 Sun Microsystems, Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions: The above copyright notice and this
# permission notice shall be included in all copies or substantial
# portions of the Software.
# 
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
# THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
# ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.
# 
# 
# Except as contained in this notice, the names of The Open Group and/or
# Sun Microsystems, Inc. shall not be used in advertising or otherwise to
# promote the sale, use or other dealings in this Software without prior
# written authorization from The Open Group and/or Sun Microsystems,
# Inc., as applicable.
# 
# 
# X Window System is a trademark of The Open Group
# 
# OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
# logo, LBX, X Window System, and Xinerama are trademarks of the Open
# Group. All other trademarks and registered trademarks mentioned herein
# are the property of their respective owners. No right, title or
# interest in or to any trademark, service mark, logo or trade name of
# Sun Microsystems, Inc. or its licensors is granted.

##
# im-sdk Makefile.in (lib/IMdkit)

## Supported targets:
#  make all
#  make install
#  make TAGS
#  make clean
#  make distclean

## Targets planned to support:
#  make dist

SHELL = /bin/sh

srcdir = .
top_srcdir = ../..
prefix = /usr
exec_prefix = ${prefix}

IM_TOPDIR = $(top_srcdir)/../..
IM_INCLUDEDIR = $(top_srcdir)/../../include
CSCONV_DIR = $(top_srcdir)/../../lib/CSConv
X_PRIVATEINC = $(top_srcdir)/../../include/X11/XFree86

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL}

CC = gcc
CXX = g++
AR = ar
AR_FLAGS = rc
LINKER = 
RANLIB = ranlib

CFLAGS = -I$(IM_INCLUDEDIR) -I$(IM_INCLUDEDIR)/iml -I$(top_srcdir)/include/iiimp -I. -I$(top_srcdir)/../../include -DARCH=\"i686\" -DHAVE_CONFIG_H -DLinux  -DSUPPORT_R6IM  -Wall                   
CXXFLAGS = -I$(IM_INCLUDEDIR) -I$(IM_INCLUDEDIR)/iml -I$(top_srcdir)/include/iiimp -I. -I$(top_srcdir)/../../include -DARCH=\"i686\" -DHAVE_CONFIG_H -DLinux  -DSUPPORT_R6IM  -fexceptions                       
LDFLAGS =  
LIBS =  -ldl

HAVE_XICCALLBACK = @HAVE_XICCALLBACK@

SHLIBCFLAGS = -fpic
SHLIBLDFLAGS = -shared
REQUIREDCPPLIB = -lc

PACKAGE = im-sdk
VERSION = 11.0

mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = 

IIIMP_OBJS = \
	iiimp/IIIMPClient.o iiimp/IIIMPClientAuxSetValues.o \
	iiimp/IIIMPClientCB.o iiimp/IIIMPClientDispatcher.o \
	iiimp/IIIMPClientDispatcher2.o iiimp/IIIMPClientDispatcher3.o \
	iiimp/IIIMProtocol.o \
	iiimp/IIimp.o iiimp/IIIMPInputContext.o

COMMON_BASE_OBJS = \
	common/CompoundString.o \
	common/IMProtocol.o \
	common/IMLanguageList.o common/IMObjectDescriptorList.o \
	common/IMEditorDescriptorList.o \
	common/IMTriggerKeyList.o common/InputContext.o

PROTOMANAGER_OBJS = common/IMProtocolManager.o


PLATFORM_OBJS = \
	solaris/CompoundStringP.o linux/IMThreadP.o solaris/IMTransP.o \
	solaris/IMTriggerKeyListP.o

XIMP_OBJS = ximp/XIMProtocol.o \
	ximp/XIMPInputContext.o \
	ximp/XIMPStatusIC.o ximp/XIMPPreeditIC.o
R6IM_OBJS1 = r6im/R6IMProtocol.o r6im/XInputContext.o
R6IM_OBJS2 = r6im/FrameMgr.o \
	r6im/i18nIMProto.o r6im/i18nAttr.o \
	r6im/i18nMethod.o r6im/i18nUtil.o \
	r6im/i18nPtHdr.o r6im/i18nIc.o \
	r6im/i18nClbk.o r6im/i18nX.o \
	r6im/i18nTr.o r6im/i18ntrans.o
R6IM_OBJS = $(R6IM_OBJS1) $(R6IM_OBJS2)

### X environment....
IMDKIT_X_OBJS = common/XIMPublic.o common/Xfactory.o
IMDKIT_X_DEFS = -DSUPPORT_XIMP -DSUPPORT_R6IM
###

COMMON_OBJS = $(COMMON_BASE_OBJS) $(IMDKIT_X_OBJS)
DEFS = $(IMDKIT_X_DEFS) -DNO_COLOR_FEEDBACK -DNO_CARET_NEGO

# ifneq (,$(findstring CYGWIN_NT,$(PLATFORM)))
# PLATFORM_SRCS = \
#	win32/CompoundStringP.cpp win32/IMThreadP.cpp win32/IMTransP.cpp \
#	win32/IMTriggerKeyListP.cpp
# endif

OBJS = $(COMMON_OBJS) $(PLATFORM_OBJS) $(IIIMP_OBJS)

CLEANFILES = $(OBJS) $(IIIMP_OBJS) $(XIMP_OBJS) $(R6IM_OBJS) $(PROTOMANAGER_OBJS)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = 

INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/include \
           -I$(IM_INCLUDEDIR) -I$(X_PRIVATEINC) \
           -I./public -I./private -I../LE_Interface\
           -I$(CSCONV_DIR)

COMPILE = $(CC) $(STD_DEFINES) $(DEFS) $(INCLUDES) $(CFLAGS) $(SHLIBCFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
CXXCOMPILE = $(CXX) $(CXXFLAGS) $(SHLIBCFLAGS) $(DEFS) $(INCLUDES)

default: all

.SUFFIXES:
.SUFFIXES: .c .cpp .o

.cpp.o:
	echo Compiling $<
	$(CXXCOMPILE) -c $< -o $@

.c.o:
	echo Compiling $<
	$(COMPILE) -c $< -o $@

CONN_DEFINES = -DTCPCONN -DUNIXCONN
XTRANS_XIM_DEFINES = -DXIM_t -DTRANS_SERVER

r6im/i18ntrans.o: r6im/i18ntrans.c
	$(COMPILE) -c $(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES) $(XTRANS_XIM_DEFINES) $< -o $@

R6IM_CONN_DEFINES = -DUSE_DIRECT_CONN

r6im/i18nTr.o: r6im/i18nTr.c
	$(COMPILE) -c $(R6IM_CONN_DEFINES) $< -o $@
r6im/i18nMethod.o: r6im/i18nMethod.c
	$(COMPILE) -c $(R6IM_CONN_DEFINES) $< -o $@

#LIBRARIES = libIMd.a libIMd_iiimp.a libIMd_ximp.a libIMd_r6im.a
LIBRARIES = libIMd_ximp.a libIMd_r6im.a

SO_LIBRARIES = libIMd.so

all: $(LIBRARIES)

ALL_OBJS = $(COMMON_OBJS) $(PROTOMANAGER_OBJS) $(PLATFORM_OBJS) \
	   $(IIIMP_OBJS) $(XIMP_OBJS) $(R6IM_OBJS)
LIB_IIIMP_OBJS = $(COMMON_OBJS) $(PLATFORM_OBJS) $(IIIMP_OBJS)
LIB_XIMP_OBJS = $(COMMON_OBJS) $(PLATFORM_OBJS) $(XIMP_OBJS)
LIB_R6IM_OBJS = $(COMMON_OBJS) $(PLATFORM_OBJS) $(R6IM_OBJS)

libIMd.a : $(ALL_OBJS)
	rm -rf $@
	$(AR) $(AR_FLAGS) $@ $(ALL_OBJS)
	$(RANLIB) $@

libIMd_iiimp.a : $(LIB_IIIMP_OBJS)
	rm -rf $@
	$(AR) $(AR_FLAGS) $@ $(LIB_IIIMP_OBJS)
	$(RANLIB) $@

libIMd_ximp.a: $(LIB_XIMP_OBJS)
	rm -rf $@
	$(AR) $(AR_FLAGS) $@ $(LIB_XIMP_OBJS)
	$(RANLIB) $@

libIMd_r6im.a: $(LIB_R6IM_OBJS)
	rm -rf $@
	$(AR) $(AR_FLAGS) $@ $(LIB_R6IM_OBJS)
	$(RANLIB) $@

shared: $(SO_LIBRARIES)

$(SO_LIBRARIES): $(ALL_OBJS)
	rm -rf $@
	$(CXX) -mt -o $@ $(SHLIBLDFLAGS) $(CFLAGS)  $(ALL_OBJS) -ldl ../../../lib/CSConv/csconv.a $(XLIB) -lsocket -ldoor -lthread $(REQUIREDCPPLIB)

## install 

install:

## clean

SUNWS_CACHE=common/SunWS_cache iiimp/SunWS_cache r6im/SunWS_cache ximp/SunWS_cache 

clean-LIBRARIES:
	test -z "$(LIBRARIES)" || rm -f $(LIBRARIES)

clean-compile:
	test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
	test -z "$(SUNWS_CACHE)" || rm -rf $(SUNWS_CACHE)

distclean-compile:
	rm -rf *.tab.c SunWS_cache Templates.DB

clean: clean-LIBRARIES clean-compile

distclean: clean distclean-compile


# DO NOT DELETE

common/CompoundString.o: ./public/CompoundString.hh
common/IMLanguageList.o: ./public/IMLanguageList.hh ./public/IMList.hh
common/IMLanguageList.o: ./public/CompoundString.hh
common/IMObjectDescriptorList.o: ./public/IMObjectDescriptorList.hh
common/IMObjectDescriptorList.o: ./public/IMList.hh
common/IMEditorDescriptorList.o: ./public/IMEditorDescriptorList.hh
common/IMEditorDescriptorList.o: ./public/IMList.hh
common/IMProtocol.o: ./public/IMProtocol.hh ./public/IMLanguageList.hh
common/IMProtocol.o: ./public/IMList.hh ./public/CompoundString.hh
common/IMProtocol.o: ./public/IMTriggerKeyList.hh ../../../../include/IMArg.h
common/IMProtocolManager.o: ./public/IMProtocolManager.hh
common/IMProtocolManager.o: ../../../../include/IMArg.h ./public/IIIMProtocol.hh
common/IMProtocolManager.o: ./public/IMProtocol.hh ./public/IMLanguageList.hh
common/IMProtocolManager.o: ./public/IMList.hh
common/IMProtocolManager.o: ./public/CompoundString.hh
common/IMProtocolManager.o: ./public/IMTriggerKeyList.hh
common/IMProtocolManager.o: ./public/XIMProtocol.hh
common/IMTriggerKeyList.o: ./public/IMTriggerKeyList.hh
common/IMTriggerKeyList.o: ./public/IMList.hh
common/InputContext.o: ./public/InputContext.hh ./public/IMList.hh
common/InputContext.o: ../../../../include/IMArg.h ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClient.o: ./public/IIIMProtocol.hh ./public/IMProtocol.hh
iiimp/IIIMPClient.o: ./public/IMLanguageList.hh ./public/IMList.hh
iiimp/IIIMPClient.o: ./public/CompoundString.hh
iiimp/IIIMPClient.o: ./public/IMTriggerKeyList.hh ../../../../include/IMArg.h
iiimp/IIIMPClient.o: iiimp/IIIMPClient.hh ./private/IMProtocolStructP.hh
iiimp/IIIMPClient.o: ../../../../include/IMProtocolStruct.h iiimp/FrameMgr.h
iiimp/IIIMPClient.o: ./public/IMTrans.hh
iiimp/IIIMPClient.o: ./public/IMThread.hh
iiimp/IIIMPClientAuxSetValues.o: iiimp/FrameMgr.h
iiimp/IIIMPClientAuxSetValues.o: ./public/IIIMProtocol.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/IMProtocol.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/IMLanguageList.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/IMList.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/CompoundString.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/IMTriggerKeyList.hh
iiimp/IIIMPClientAuxSetValues.o: ../../../../include/IMArg.h iiimp/IIIMPClient.hh
iiimp/IIIMPClientAuxSetValues.o: ./public/IMProtoHandler.hh
iiimp/IIIMPClientAuxSetValues.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClientAuxSetValues.o: ./private/IMProtocolStructP.hh
iiimp/IIIMPClientCB.o: iiimp/FrameMgr.h
iiimp/IIIMPClientCB.o: iiimp/IIIMPClient.hh
iiimp/IIIMPClientCB.o: ./public/IMList.hh
iiimp/IIIMPClientCB.o: ./public/CompoundString.hh
iiimp/IIIMPClientCB.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClientCB.o: ./private/IMProtocolStructP.hh ./public/IMTrans.hh
iiimp/IIIMPClientDispatcher.o: iiimp/FrameMgr.h
iiimp/IIIMPClientDispatcher.o: iiimp/IIIMPClient.hh ./public/IMList.hh
iiimp/IIIMPClientDispatcher.o: ./public/CompoundString.hh
iiimp/IIIMPClientDispatcher.o: ./public/IMProtoHandler.hh
iiimp/IIIMPClientDispatcher.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClientDispatcher.o: ./public/InputContext.hh ../../../../include/IMArg.h
iiimp/IIIMPClientDispatcher.o: ./public/IIIMProtocol.hh
iiimp/IIIMPClientDispatcher.o: ./public/IMProtocol.hh
iiimp/IIIMPClientDispatcher.o: ./public/IMLanguageList.hh
iiimp/IIIMPClientDispatcher.o: ./public/IMTriggerKeyList.hh
iiimp/IIIMPClientDispatcher.o: ./public/IMTrans.hh
iiimp/IIIMPClientDispatcher2.o: iiimp/FrameMgr.h
iiimp/IIIMPClientDispatcher2.o: iiimp/IIIMPClient.hh ./public/IMList.hh
iiimp/IIIMPClientDispatcher2.o: ./public/CompoundString.hh
iiimp/IIIMPClientDispatcher2.o: ./public/IMProtoHandler.hh
iiimp/IIIMPClientDispatcher2.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClientDispatcher2.o: iiimp/IIIMPInputContext.hh
iiimp/IIIMPClientDispatcher2.o: ./public/InputContext.hh
iiimp/IIIMPClientDispatcher2.o: ../../../../include/IMArg.h
iiimp/IIIMPClientDispatcher2.o: ./private/ICAttribute.hh
iiimp/IIIMPClientDispatcher2.o: ./public/IIIMProtocol.hh
iiimp/IIIMPClientDispatcher2.o: ./public/IMProtocol.hh
iiimp/IIIMPClientDispatcher2.o: ./public/IMLanguageList.hh
iiimp/IIIMPClientDispatcher2.o: ./public/IMTriggerKeyList.hh
iiimp/IIIMPClientDispatcher2.o: ./private/IMProtocolStructP.hh
iiimp/IIIMPClientDispatcher3.o: iiimp/FrameMgr.h
iiimp/IIIMPClientDispatcher3.o: iiimp/IIIMPClient.hh ./public/IMList.hh
iiimp/IIIMPClientDispatcher3.o: ./public/CompoundString.hh
iiimp/IIIMPClientDispatcher3.o: ./public/IMProtoHandler.hh
iiimp/IIIMPClientDispatcher3.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPClientDispatcher3.o: iiimp/IIIMPInputContext.hh
iiimp/IIIMPClientDispatcher3.o: ./public/InputContext.hh
iiimp/IIIMPClientDispatcher3.o: ../../../../include/IMArg.h
iiimp/IIIMPClientDispatcher3.o: ./private/ICAttribute.hh
iiimp/IIIMPClientDispatcher3.o: ./public/IIIMProtocol.hh
iiimp/IIIMPClientDispatcher3.o: ./public/IMProtocol.hh
iiimp/IIIMPClientDispatcher3.o: ./public/IMLanguageList.hh
iiimp/IIIMPClientDispatcher3.o: ./public/IMTriggerKeyList.hh
iiimp/IIIMPClientDispatcher3.o: ./private/IMProtocolStructP.hh
iiimp/IIIMPInputContext.o: iiimp/IIIMPClient.hh ./public/IMList.hh
iiimp/IIIMPInputContext.o: ./public/CompoundString.hh
iiimp/IIIMPInputContext.o: iiimp/IIIMPInputContext.hh
iiimp/IIIMPInputContext.o: ./public/InputContext.hh ../../../../include/IMArg.h
iiimp/IIIMPInputContext.o: ../../../../include/IMProtocolStruct.h
iiimp/IIIMPInputContext.o: ./private/IMProtocolStructP.hh
iiimp/IIIMProtocol.o: ./public/IIIMProtocol.hh ./public/IMProtocol.hh
iiimp/IIIMProtocol.o: ./public/IMLanguageList.hh ./public/IMList.hh
iiimp/IIIMProtocol.o: ./public/CompoundString.hh
iiimp/IIIMProtocol.o: ./public/IMTriggerKeyList.hh ../../../../include/IMArg.h
iiimp/IIIMProtocol.o: iiimp/IIIMPClient.hh ./public/IMTrans.hh
iiimp/IIIMProtocol.o: ./public/IMThread.hh
iiimp/IIimp.o: iiimp/FrameMgr.h
solaris/CompoundStringP.o: ./public/CompoundString.hh
solaris/IMThreadP.o: ./public/IMThread.hh
solaris/IMTransP.o: ./public/IMTrans.hh ./public/CompoundString.hh
solaris/IMTriggerKeyListP.o: ./public/IMTriggerKeyList.hh
solaris/IMTriggerKeyListP.o: ./public/IMList.hh
solaris/IMTriggerKeyListP.o: ./public/CompoundString.hh
win32/CompoundStringP.o: ./public/CompoundString.hh
win32/IMThreadP.o: ./public/IMThread.hh
win32/IMTransP.o: ./public/IMTrans.hh ./public/CompoundString.hh
win32/IMTriggerKeyListP.o: ./public/IMTriggerKeyList.hh
win32/IMTriggerKeyListP.o: ./public/IMList.hh
ximp/XIMProtocol.o: ./public/IMProtoHandler.hh ../../../../include/IMProtocolStruct.h
ximp/XIMProtocol.o: public/XIMProtocol.hh ximp/XIMPInputContext.hh
ximp/XIMProtocol.o: private/XIMProto.hh ./public/IMThread.hh private/Xfactory.hh
ximp/XIMProtocol.o: ./public/IMList.hh ./public/IMProtocol.hh

ximp/XIMPInputContext.o: ./public/IMList.hh ./public/IMProtocol.hh
ximp/XIMPInputContext.o: public/XIMProtocol.hh ximp/XIMPInputContext.hh
ximp/XIMPInputContext.o: private/Xfactory.hh
ximp/XIMPInputContext.o: private/XIMProto.hh ./public/InputContext.hh
ximp/XIMPInputContext.o: ./public/CompoundString.hh
ximp/XIMPInputContext.o: ./public/IMLanguageList.hh
ximp/XIMPInputContext.o: ./public/IMTriggerKeyList.hh ../../../../include/IMArg.h

ximp/XIMPPreeditIC.o: public/XIMProtocol.hh
ximp/XIMPPreeditIC.o: ximp/XIMPInputContext.hh
ximp/XIMPPreeditIC.o: private/Xfactory.hh

ximp/XIMPStatusIC.o: public/XIMProtocol.hh
ximp/XIMPStatusIC.o: ximp/XIMPInputContext.hh
ximp/XIMPStatusIC.o: private/Xfactory.hh
