#
# 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.5$${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 astro.o \
	portrait.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     -pthread -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 -pthread -D_REENTRANT -DORBIT2=1 -I/usr/include/libgtkhtml-3.14 -I/usr/include/gtk-2.0 -I/usr/include/enchant -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/gio-unix-2.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/directfb -I/usr/include/libpng12 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   -DBCT -pthread -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/gio-unix-2.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/directfb -I/usr/include/libpng12   -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   -DUSE_LIBGPS
LDFLAGS =  -pthread -lgnomevfs-2 -lgconf-2 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lxml2   -lcurl   -pthread -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -pthread -lgtkhtml-3.14 -lgtk-x11-2.0 -lenchant -lgconf-2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0   -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -pthread -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lgmodule-2.0 -lORBit-2 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lespeak -lgps   -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

about.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
about.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
about.o: precpos.h garmin_export.h geotoad.h about.h misc.h
bct.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
bct.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
bct.o: precpos.h garmin_export.h geotoad.h about.h misc.h
cache.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
cache.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
cache.o: precpos.h garmin_export.h geotoad.h about.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 gcvote.h gconf.h html.h icons.h geomath.h
custom_rating_renderer.o: geotext.h notes.h help.h mm_poi.h precpos.h
custom_rating_renderer.o: garmin_export.h geotoad.h about.h misc.h
custom_rating_renderer.o: 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 gcvote.h gconf.h html.h icons.h geomath.h
custom_size_renderer.o: geotext.h notes.h help.h mm_poi.h precpos.h
custom_size_renderer.o: garmin_export.h geotoad.h about.h misc.h
custom_size_renderer.o: 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 gcvote.h gconf.h html.h icons.h geomath.h
custom_type_renderer.o: geotext.h notes.h help.h mm_poi.h precpos.h
custom_type_renderer.o: garmin_export.h geotoad.h about.h misc.h
custom_type_renderer.o: custom_type_renderer.h
dbus.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
dbus.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
dbus.o: precpos.h garmin_export.h geotoad.h about.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: gcvote.h gconf.h html.h icons.h geomath.h geotext.h notes.h
garmin_export.o: help.h mm_poi.h precpos.h garmin_export.h geotoad.h about.h
garmin_export.o: misc.h
gconf.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
gconf.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
gconf.o: precpos.h garmin_export.h geotoad.h about.h misc.h
gcvote.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
gcvote.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
gcvote.o: precpos.h garmin_export.h geotoad.h about.h misc.h
geomath.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
geomath.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
geomath.o: precpos.h garmin_export.h geotoad.h about.h misc.h
geotext.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
geotext.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
geotext.o: precpos.h garmin_export.h geotoad.h about.h misc.h
geotoad.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
geotoad.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
geotoad.o: precpos.h garmin_export.h geotoad.h about.h misc.h
goto.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
goto.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
goto.o: precpos.h garmin_export.h geotoad.h about.h misc.h
gps.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
gps.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
gps.o: precpos.h garmin_export.h geotoad.h about.h misc.h
gpx.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
gpx.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
gpx.o: precpos.h garmin_export.h geotoad.h about.h misc.h unzip.h ioapi.h
html.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
html.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
html.o: precpos.h garmin_export.h geotoad.h about.h misc.h
icons.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
icons.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
icons.o: precpos.h garmin_export.h geotoad.h about.h misc.h
ioapi.o: ioapi.h
main.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
main.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
main.o: precpos.h garmin_export.h geotoad.h about.h misc.h
main.o: custom_size_renderer.h custom_rating_renderer.h
main.o: custom_type_renderer.h
map-tool.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
map-tool.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h
map-tool.o: mm_poi.h precpos.h garmin_export.h geotoad.h about.h misc.h
map-tool.o: converter.h
misc.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
misc.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
misc.o: precpos.h garmin_export.h geotoad.h about.h misc.h
mm_poi.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
mm_poi.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
mm_poi.o: precpos.h garmin_export.h geotoad.h about.h misc.h
notes.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
notes.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
notes.o: precpos.h garmin_export.h geotoad.h about.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 gcvote.h
precpos.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h mm_poi.h
precpos.o: precpos.h garmin_export.h geotoad.h about.h misc.h
settings.o: gpxview.h config.h gpx.h settings.h gps.h goto.h cache.h gcvote.h
settings.o: gconf.h html.h icons.h geomath.h geotext.h notes.h help.h
settings.o: mm_poi.h precpos.h garmin_export.h geotoad.h about.h misc.h
unzip.o: unzip.h ioapi.h crypt.h
