#
# gpxview
#

APP = gpxview
PREFIX = /usr/local

include version.mk

PKGS = libxml-2.0 libgtkhtml-3.8 gtk+-2.0 gconf-2.0 \
	gnome-vfs-module-2.0 sqlite3

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 mm_poi.o unzip.o ioapi.o precpos.o \
	garmin_export.o geotext.o

DEFS = -DVERSION=\"$(VERSION)\" -DICONPATH=\"$(PREFIX)/share/$(APP)/\"
CFLAGS = -Wall -O2 $(DEFS) `pkg-config --cflags $(PKGS)`
LDFLAGS = `pkg-config --libs $(PKGS)` -lz

all: $(APP)

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

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

install:
	install $(APP) $(DESTDIR)$(PREFIX)/bin
	install -m 644 icons/*.gif $(DESTDIR)$(PREFIX)/share/$(APP)
	install -m 644 help/gpxview.html $(DESTDIR)$(PREFIX)/share/$(APP)

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

# 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
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
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
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
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
