# ***************************************************** -*- Makefile -*-
#
# Copyright (C) 2004-2007 Andreas Huggel <ahuggel@gmx.net>
#
# This Makefile is part of the Exiv2 distribution.
#
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
#
# File:      config.mk.in
# Version:   $Rev$
# Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
# History:   10-Dec-03, ahu: created
#
# Description: 
#  Exiv2 system configuration file.
#

# **********************************************************************
# Exiv2 version for use with libtool (-version-info argument)
EXIV2_LTVERSION = @EXIV2_LTVERSION@
# Compile for use with a commercial license
COMMERCIAL_VERSION = @COMMERCIAL_VERSION@

# **********************************************************************
# Libtool
LIBTOOL = $(top_srcdir)/libtool
LIBTOOL_DEPS = @LIBTOOL_DEPS@

# **********************************************************************
# C++ Compiler and precompiler
CXX = @CXX@
GXX = @GXX@

# Common compiler flags (warnings, symbols [-ggdb], optimization [-O2], etc)
CXXFLAGS = @CXXFLAGS@
ifeq ($(GXX),yes)
	CXXFLAGS += -Wall -Wcast-align -Wconversion -Wpointer-arith -Wformat-security -Wmissing-format-attribute -W
endif

# Command to run only the preprocessor
CXXCPP = @CXXCPP@

# Preprocessor flags
CPPFLAGS = -I. @CPPFLAGS@ -DEXV_LOCALEDIR=\"$(localedir)\"
ifeq ($(COMMERCIAL_VERSION),yes)
	CPPFLAGS += -DEXV_COMMERCIAL_VERSION=1
endif

# Linker flags and libraries
LDFLAGS = @LDFLAGS@
LIBS = @LTLIBINTL@ @LTLIBICONV@ @LIBS@

# Suffix of executables
EXEEXT := @EXEEXT@

# **********************************************************************
# C Compiler
CC = @CC@
GCC = @GCC@

CFLAGS = @CFLAGS@
ifeq ($(GCC),yes)
	CFLAGS += -Wall
endif

# **********************************************************************
# XMP support
ENABLE_XMP = 1

ifdef ENABLE_XMP
	CPPFLAGS += -DEXV_HAVE_XMP_TOOLKIT -DUNIX_ENV -I$(top_srcdir)/XMP-SDK/public/include
	LDFLAGS += -L$(top_srcdir)/XMP-SDK/public/libraries/i80386linux/debug -lXMPCoreStaticDebug
else
        # XMP Toolkit doesn't compile cleanly with these
	ifeq ($(GXX),yes)
		CXXFLAGS += -Wundef -pedantic
	endif
endif

# **********************************************************************
# Libraries and Functions
HAVE_LIBZ = @HAVE_LIBZ@
HAVE_TIMEGM = @HAVE_TIMEGM@

# **********************************************************************
# Advanced auto-dependency generation
# http://make.paulandlesley.org/autodep.html
DEP_TRACKING = @DEP_TRACKING@

ifdef DEP_TRACKING
# Compiler flags to generate dependency files at the same time 
# as object files (for gcc)
ifeq ($(GXX),yes)
	CXXFLAGS += -MMD
	CFLAGS += -MMD
	MAKEDEPEND =
else
# Command to run the compiler or preprocessor to produce dependencies.
# If you're not using gcc, you may need to change this to something 
# suitable for your compiler or simply unset the variable. See the link
# above for suggestions
	MAKEDEPEND = $(CXX) -MM $(CPPFLAGS) -o $*.d $<
endif

endif

# **********************************************************************
# Installation programs
INSTALL_EXE = @INSTALL@
INSTALL_PROGRAM = $(INSTALL_EXE)
INSTALL_DATA = $(INSTALL_EXE) -m 644
INSTALL_DIRS = $(top_srcdir)/config/mkinstalldirs

# **********************************************************************
# Other programs
RM = rm -f

# **********************************************************************
# Directories
prefix = @prefix@
exec_prefix = @exec_prefix@

# Source directory
srcdir = @srcdir@

# Installation directories
bindir = @bindir@
datarootdir = @datarootdir@
datadir = @datadir@
localedir = $(datadir)/locale
incdir = @includedir@/exiv2
libdir = @libdir@
mandir = @mandir@
man1dir = $(mandir)/man1
