top_builddir = ../..
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@

LIBDIR = $(DESTDIR)$(libdir)/mlterm

VPATH = ${top_srcdir}/inputmethod/m17nlib

IM_M17NLIB_OBJ = im_m17nlib.o

CFLAGS = $(CFLAGS_LOCAL) 		\
	 @KIK_CFLAGS@			\
	 @MKF_CFLAGS@			\
	 @DEB_CFLAGS@			\
	 @X_CFLAGS@			\
	 @CFLAGS@			\
	 @CPPFLAGS@			\
	 @IM_CFLAGS@			\
	 @M17NLIB_CFLAGS@		\
	 -I$(top_srcdir)/mlterm		\
	 -I${top_srcdir}/xwindow	\
	 -I/usr/local/include

LIBS = $(LIBS_LOCAL) @KIK_LIBS_FOR_MODULE@ @M17NLIB_LIBS@

CC      = @CC@
INSTALL = @INSTALL@
LIBTOOL = @LIBTOOL@

LIBTOOL_CC      = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS)
LIBTOOL_LINK    = $(LIBTOOL) --mode=link $(CC)
LIBTOOL_INSTALL = $(LIBTOOL) --mode=install $(INSTALL)

.SUFFIXES: .o .c

all: libim-m17nlib.la

libim-m17nlib.la: $(IM_M17NLIB_OBJ)
	$(LIBTOOL_LINK) -o libim-m17nlib.la $(IM_M17NLIB_OBJ:.o=.lo) \
	-rpath $(libdir)/mlterm \
	-module -avoid-version @NO_UNDEFINED_FLAG@ $(LIBS)

.c.o:
	$(LIBTOOL_CC) -c $<

$(LIBDIR):
	mkdir -p $(LIBDIR)

install: $(LIBDIR)
	$(LIBTOOL_INSTALL) libim-m17nlib.la $(LIBDIR)

clean:
	rm -rf $(IM_M17NLIB_OBJ) $(IM_M17NLIB_OBJ:.o=.lo) libim-m17nlib.la *.core .libs

distclean: clean
	rm -f Makefile

