#
# 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
EXTRA_OBJS =  converter.o osm-gps-map.o map-tool.o osm-gps-map-osd-classic.o dbus.o
VERSION = $${VERSION_PREFIX}0.8.11$${VERSION_SUFFIX}

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 $(EXTRA_OBJS)

DEFS = -DVERSION=\"$(VERSION)\" -DICONPATH=\"$(PREFIX)/share/$(APP)/\" -DAPP=\"$(APP)\"
CFLAGS = -Wall -O2 $(DEFS) -g -O2 -pthread -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/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 -DDISABLE_GNOME -DDISABLE_PRINTING -DDISABLE_A11Y -DMAEMO_CHANGES -I/usr/include/libgtkhtml-3.14 -I/usr/include/gtk-2.0 -I/usr/include/gconf/2 -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/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include    -DUSE_MAEMO -DMAEMO_CHANGES -DMAEMO_GTK -I/usr/include/hildon-1 -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/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/dbus-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/dbus-1.0/include   -DMAEMO_CHANGES -pthread -I/usr/include/hildon-fm-2 -I/usr/include/gtk-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -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/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include     -DENABLE_LIBLOCATION -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DENABLE_BROWSER_INTERFACE -DMAEMO_VERSION=\"5.0\" -DMAEMO_VERSION_MAJOR=5
LDFLAGS =  -pthread -lgnomevfs-2 -lgconf-2 -lgthread-2.0 -lrt -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0   -lxml2   -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lgtkhtml-3.14 -lgtk-x11-2.0 -lgconf-2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0   -lhildon-1 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -losso -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0   -pthread -lhildonfm -lgtk-x11-2.0 -lgnomevfs-2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgconf-2 -lgthread-2.0 -lrt -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0   -lsqlite3   -llocation -lgconf-2 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0   -lz

all: $(APP)

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

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

install:
	install -d $(DESTDIR)$(PREFIX)$(bindir)
	install $(APP) $(DESTDIR)$(PREFIX)$(bindir)

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

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


# DO NOT DELETE

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 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: 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: 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: 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 misc.h
unzip.o: unzip.h ioapi.h crypt.h
