top_builddir = ../..
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libexecdir = @libexecdir@
bindir = @bindir@

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

LIBEXECDIR = $(DESTDIR)$(libexecdir)/mlterm
LIBEXECDIR_win32 = $(DESTDIR)$(bindir)

VPATH = $(top_srcdir)/tool/registobmp

OBJ = main.o

CFLAGS = $(CFLAGS_LOCAL) @POBL_CFLAGS@ @DEB_CFLAGS@ @CFLAGS@ @CPPFLAGS@ @SDL_CFLAGS@ @GUI_CFLAGS@ \
	@FONTCONFIG_CFLAGS@ -I/usr/local/include

LIBS = $(LIBS_LOCAL) @SDL_LIBS@ @FONTCONFIG_LIBS@ -L/usr/local/lib -R/usr/local/lib -lm

PROG = registobmp

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

all: $(PROG)

$(PROG): $(OBJ)
	$(LIBTOOL_LINK) $(CFLAGS) -o $(PROG) $(OBJ:.o=.lo) $(LIBS)

.SUFFIXES: .c .o

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

$(LIBEXECDIR@WIN32TAG@):
	mkdir -p $(LIBEXECDIR@WIN32TAG@)

install: $(LIBEXECDIR@WIN32TAG@)
	$(LIBTOOL_INSTALL) $(PROG) $(LIBEXECDIR@WIN32TAG@)

uninstall:
	rm -f $(LIBEXECDIR@WIN32TAG@)/$(PROG)

wc:
	find . -name "*.[ch]" -a \! -name "test_*" | xargs wc -l

clean:
	rm -rf $(PROG) $(PROG).exe *core $(OBJ) $(OBJ:.o=.lo) .libs

distclean: clean
	rm -f Makefile
