top_builddir = ..
top_srcdir = @top_srcdir@
prefix = @prefix@
sysconfdir = @sysconfdir@
exec_prefix = @exec_prefix@
datadir = @datadir@
bindir = @bindir@
libdir = @libdir@
libexecdir = @libexecdir@

LIBDIR = $(DESTDIR)$(libdir)

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

VPATH = $(top_srcdir)/gtk

CFLAGS = $(CFLAGS_LOCAL) @TYPE_CFLAGS@ @DEB_CFLAGS@ @SSH2_CFLAGS@ \
	-DSYSCONFDIR=\"$(sysconfdir)\" @VTE_CFLAGS@ @CFLAGS@ @CPPFLAGS@

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

OBJ = vte.o marshal.o vtetypebuiltins.o reaper.o

all: libvte@LIBVTE_SUFFIX@.la

libvte@LIBVTE_SUFFIX@.la: $(OBJ)
	$(LIBTOOL_LINK) -o libvte@LIBVTE_SUFFIX@.la $(OBJ:.o=.lo) ../mlterm/*.lo \
	`echo ../xwindow/*.lo| \
	sed 's/..\/xwindow\/x_sb_screen.lo//g' | \
	sed 's/..\/xwindow\/x_scrollbar.lo//g' | \
	sed 's/..\/xwindow\/x_sb_view_factory.lo//g' | \
	sed 's/..\/xwindow\/x_connect_dialog.lo//g' | \
	sed 's/..\/xwindow\/x_simple_sb_view.lo//g' | \
	sed 's/..\/xwindow\/x_screen_manager.lo//g' | \
	sed 's/..\/xwindow\/x_event_source.lo//g'` \
	$(top_builddir)/kiklib/src/libkik.la $(top_builddir)/mkf/lib/libmkf.la \
	@IMAGELIB_LIBS@ @DL_LIBS_IM@ @GTK_LIBS@ @CTL_LIBS_FOR_VTE@ @TYPE_LIBS_FOR_VTE@ @DEXPORT@ \
	-rpath $(libdir) -version-info 9:0:0

.c.o:
	$(LIBTOOL_CC) $(CFLAGS) -I$(top_srcdir)/mlterm -I$(top_srcdir)/xwindow \
		-I$(top_builddir)/xwindow -I../mkf/include -I../kiklib/include -g -c $<

clean:
	rm -rf $(OBJ) $(OBJ:.o=.lo) libvte@LIBVTE_SUFFIX@.la *.core .libs

distclean: clean
	rm -f Makefile

install:
	$(LIBTOOL_INSTALL) libvte@LIBVTE_SUFFIX@.la $(LIBDIR)

uninstall:
	rm -f $(LIBDIR)/libvte@LIBVTE_SUFFIX@.*
