#
# Copyright (C) 2008 Till Harbaum <till@harbaum.org>.
#
# This file is part of GPXView.
#
# GPXView 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.
#
# GPXView 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 GPXView.  If not, see <http://www.gnu.org/licenses/>.
#

APP = gpxview
prefix = /usr
datarootdir = ${prefix}/share
datadir = ${prefix}/share
EXTRA_OBJS =  converter.o osm-gps-map.o map-tool.o osm-gps-map-osd-classic.o bct.o
VERSION = $${VERSION_PREFIX}0.9.2$${VERSION_SUFFIX}
MAEMO_VERSION_MAJOR = 

bindir = ${exec_prefix}/bin

OBJS = main.o gpx.o goto.o gps.o misc.o gconf.o html.o icons.o cache.o \
	geomath.o settings.o custom_size_renderer.o custom_rating_renderer.o \
	notes.o custom_type_renderer.o unzip.o ioapi.o precpos.o \
	garmin_export.o geotext.o gcvote.o geotoad.o about.o $(EXTRA_OBJS) 

DEFS = -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" -DICONPATH=\"$(datadir)/$(APP)/\" -DAPP=\"$(APP)\"
CFLAGS = -Wall -O2 $(DEFS) -g -O2 -pthread -DORBIT2=1 -I/usr/include/gnome-vfs-2.0 -I/usr/include/gnome-vfs-module-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include/libxml2     -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DENABLE_OSM_GPS_MAP -DORBIT2=1 -pthread -D_REENTRANT -I/usr/include/libgtkhtml-3.8 -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnomeprintui-2.2 -I/usr/include/libglade-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/libgnomeprint-2.2   -DBCT -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DORBIT2=1 -pthread -I/usr/include/libgnome-2.0 -I/usr/include/orbit-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/bonobo-activation-2.0   -DENABLE_BROWSER_INTERFACE -DESPEAK
LDFLAGS =  -pthread -lgnomevfs-2 -lgconf-2 -lgthread-2.0 -lrt -lgmodule-2.0 -lgobject-2.0 -lglib-2.0   -lxml2   -lcurl   -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -pthread -lgtkhtml-3.8 -lgnomeui-2 -lSM -lICE -lgnomeprintui-2-2 -lglade-2.0 -lbonoboui-2 -lgnomevfs-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lgconf-2 -lgthread-2.0 -lrt -lgnomeprint-2-2 -lz -lgnomecanvas-2 -lart_lgpl_2 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -pthread -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lgmodule-2.0 -lORBit-2 -lgthread-2.0 -lrt -lgobject-2.0 -lglib-2.0   -lespeak -lz

all: $(APP)

%.o: %.c Makefile
	gcc $(CFLAGS) -o $@ -c $<

$(APP): $(OBJS)
	gcc -o $@ $(OBJS) $(LDFLAGS)

install:
	install -d $(DESTDIR)$(prefix)$(bindir)
	if [ "$(MAEMO_VERSION_MAJOR)" == "5" ]; then \
		echo "Optifying binary"; \
		install -d $(DESTDIR)$(datadir)/$(APP); \
		install $(APP) $(DESTDIR)$(datadir)/$(APP)/$(APP).bin; \
		ln -s $(datadir)/$(APP)/$(APP).bin $(DESTDIR)$(prefix)$(bindir)/$(APP); \
	else \
		echo "Not Optifying binary"; \
		install $(APP) $(DESTDIR)$(prefix)$(bindir); \
	fi

clean:
	rm -f gpxview *.o *~ \#*\#

dep:
	makedepend -Y -fMakefile.in *.c


# DO NOT DELETE

bct.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
bct.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
bct.o: garmin_export.h gcvote.h misc.h
cache.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
cache.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
cache.o: garmin_export.h gcvote.h misc.h
converter.o: osm-gps-map-types.h osm-gps-map.h config.h converter.h
custom_rating_renderer.o: gpxview.h config.h gpx.h settings.h gps.h goto.h
custom_rating_renderer.o: cache.h gconf.h html.h icons.h geomath.h geotext.h
custom_rating_renderer.o: notes.h help.h mm_poi.h precpos.h garmin_export.h
custom_rating_renderer.o: gcvote.h misc.h custom_rating_renderer.h
custom_size_renderer.o: gpxview.h config.h gpx.h settings.h gps.h goto.h
custom_size_renderer.o: cache.h gconf.h html.h icons.h geomath.h geotext.h
custom_size_renderer.o: notes.h help.h mm_poi.h precpos.h garmin_export.h
custom_size_renderer.o: gcvote.h misc.h custom_size_renderer.h
custom_type_renderer.o: gpxview.h config.h gpx.h settings.h gps.h goto.h
custom_type_renderer.o: cache.h gconf.h html.h icons.h geomath.h geotext.h
custom_type_renderer.o: notes.h help.h mm_poi.h precpos.h garmin_export.h
custom_type_renderer.o: gcvote.h misc.h custom_type_renderer.h
dbus.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
dbus.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
dbus.o: garmin_export.h gcvote.h misc.h dbus.h
garmin_export.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h
garmin_export.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h
garmin_export.o: mm_poi.h precpos.h garmin_export.h gcvote.h misc.h
gconf.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
gconf.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
gconf.o: garmin_export.h gcvote.h misc.h
gcvote.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
gcvote.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
gcvote.o: precpos.h garmin_export.h gcvote.h misc.h
geomath.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
geomath.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
geomath.o: precpos.h garmin_export.h gcvote.h misc.h
geotext.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
geotext.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
geotext.o: precpos.h garmin_export.h gcvote.h misc.h
goto.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
goto.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
goto.o: garmin_export.h gcvote.h misc.h
gps.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
gps.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
gps.o: garmin_export.h gcvote.h misc.h
gpx.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
gpx.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
gpx.o: garmin_export.h gcvote.h misc.h unzip.h ioapi.h
html.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
html.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
html.o: garmin_export.h gcvote.h misc.h
icons.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
icons.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
icons.o: garmin_export.h gcvote.h misc.h
ioapi.o: ioapi.h
main.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
main.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
main.o: garmin_export.h gcvote.h misc.h custom_size_renderer.h
main.o: custom_rating_renderer.h custom_type_renderer.h
map-tool.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
map-tool.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
map-tool.o: precpos.h garmin_export.h gcvote.h misc.h converter.h
misc.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
misc.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
misc.o: garmin_export.h gcvote.h misc.h
mm_poi.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
mm_poi.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
mm_poi.o: precpos.h garmin_export.h gcvote.h misc.h
notes.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
notes.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h precpos.h
notes.o: garmin_export.h gcvote.h misc.h
osm-gps-map.o: config.h converter.h osm-gps-map-types.h osm-gps-map.h
osm-gps-map-osd-classic.o: config.h osm-gps-map.h converter.h
osm-gps-map-osd-classic.o: osm-gps-map-osd-classic.h
precpos.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
precpos.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
precpos.o: precpos.h garmin_export.h gcvote.h misc.h
settings.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gconf.h
settings.o: html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
settings.o: precpos.h garmin_export.h gcvote.h misc.h
unzip.o: unzip.h ioapi.h crypt.h
