
#   Copyright
#
#       Copyright (C) 2000-2010 Jean-Pierre Demailly <demailly@fourier.ujf-grenoble.fr>
#
#   License
#
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 3 of the License, or
#       (at your option) any later version.
#
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#       GNU General Public License for more details.
#
#       You should have received a copy of the GNU General Public License
#       along with this program. If not, see <http://www.gnu.org/licenses/>.



   XFT_INCLUDES = $(shell pkg-config --cflags xft)
         XPMLIB = $(shell pkg-config --libs xpm)
         PNGLIB = $(shell pkg-config --libs libpng)
         XFTLIB = $(shell pkg-config --libs xft fontconfig) 
        JPEGLIB = -ljpeg

           SRCS = xsnap.c
           OBJS = xsnap.o

 EXTRA_INCLUDES = $(XPM_INCLUDES) $(XFT_INCLUDES)

/* If you put anything here the libs are linked in the wrong order [Steff] */
EXTRA_LIBRARIES =

/* This is the right link order [Steff] */
LOCAL_LIBRARIES = -lz $(XPMLIB) $(XFTLIB) $(PNGLIB) $(JPEGLIB) $(XLIB)

	DEFINES = -DENABLE_NLS -DXPM -DPNG -DJPG -DPACKAGE=\"xsnap\" -DLOCALEDIR=\"/usr/share/locale\"

#        DEFINES = -DXPM -DPNG -DJPG -DPACKAGE=\"xsnap\" -DLOCALEDIR=\"/usr/share/locale\"

ComplexProgramTarget(xsnap)

all::
	cd po ; $(MAKE)
	$(MAKE) -f pod2man.mk PACKAGE=xsnap makeman
	$(MAKE) -f pod2man.mk PACKAGE=xsnap-ocr makeman
	gzip -f xsnap.1 xsnap-ocr.1

xsnap.man:
	touch xsnap.man

install::
	install -m 755 xsnap-ocr $(DESTDIR)/$(BINDIR)
	chmod a+rx $(DESTDIR)/$(BINDIR)/xsnap-ocr
	install -d -m 755 $(DESTDIR)/usr/share/man/man1
	install -m 644 xsnap.1.gz xsnap-ocr.1.gz $(DESTDIR)/usr/share/man/man1
	cd po ; $(MAKE) install

clean::
	cd po ; $(MAKE) clean
	rm -f *stamp *.man *._man *.1.gz

strip::
	strip $(DESTDIR)/$(BINDIR)/xsnap
