APP = gpxview
PREFIX = /usr
datadir = ${prefix}/share

LANGS = en_GB de_DE

all:

clean:

install-debian:
#	install -m 644 help/gpxview.html $(DESTDIR)$(PREFIX)/share/$(APP)

install-maemo:
	install -d $(DESTDIR)$(PREFIX)$(datadir)/applications/hildon
	install $(APP).desktop $(DESTDIR)$(PREFIX)$(datadir)/applications/hildon
	for s in 40 26; do \
	  install -d $(DESTDIR)$(PREFIX)$(datadir)/icons/hicolor/$${s}x$${s}/hildon ;\
	  install -m 644 $(APP).$$s.png $(DESTDIR)$(PREFIX)$(datadir)/icons/hicolor/$${s}x$${s}/hildon/$(APP).png ;\
	done
	install -d $(DESTDIR)$(PREFIX)$(datadir)/icons/hicolor/scalable/hildon
	install -m 644 $(APP).64.png $(DESTDIR)$(PREFIX)$(datadir)/icons/hicolor/scalable/hildon/$(APP).png
	for LANG in $(LANGS); do \
		install -d $(DESTDIR)$(PREFIX)/share/osso-help/$${LANG} ;\
		install -m 644 ../help/$${LANG}/*.xml $(DESTDIR)$(PREFIX)/share/osso-help/$${LANG} ;\
	done

install: install-maemo
	install -d $(DESTDIR)$(PREFIX)/share/$(APP)
	install -m 644 icons/*.gif icons/*.png $(DESTDIR)$(PREFIX)/share/$(APP)
	install -m 644 welcome.gpx icons/*.png $(DESTDIR)$(PREFIX)/share/$(APP)
	for LANG in $(LANGS); do \
		install -d $(DESTDIR)$(PREFIX)/share/locale/$${LANG}/LC_MESSAGES ;\
		msgfmt ../po/$${LANG}.po -o $(DESTDIR)$(PREFIX)/share/locale/$${LANG}/LC_MESSAGES/$(APP).mo ;\
	done

