# INSTALLLOC =
# INSTALLLOC = /home/forsberg/mileage/trunk/src/debian/mileage
INSTALLLOC = ./debian/mileage
BINDIR = /usr/bin
# BINDIR = $(INSTALLLOC)/usr/bin

OBJS = \
	car_tab.o \
	entry_tab.o \
	data_tab.o \
	care_tab.o \
	common_tab.o \
	graph_tab.o \
	trip_tab.o \
	mileage.o \
	mileagecfg.o \
	mileagefile.o


all: mileage

mileage: ${OBJS}
	gcc -O2 -DMAEMO `pkg-config --libs gtk+-2.0 hildon-1 hildon-help dbus-1 libosso` -ansi -Wall -o mileage ${OBJS} 

.c.o:
	gcc -O2 -DMAEMO  `pkg-config --cflags gtk+-2.0 hildon-1 hildon-help dbus-1` -ansi -Wall -c $*.c

clean:
	rm -rf ${OBJS} mileage

install: mileage
	install -d $(BINDIR)
	install -m 755 mileage $(BINDIR)
	install -d $(INSTALLLOC)/usr/share/applications/hildon
	install -m 644 mileage.desktop $(INSTALLLOC)/usr/share/applications/hildon/mileage.desktop
	install -d $(INSTALLLOC)/usr/share/dbus-1/services
	install -m 644 com.nokia.mileage.service $(INSTALLLOC)/usr/share/dbus-1/services/com.nokia.mileage.service
	install -d $(INSTALLLOC)/usr/share/osso-help/en_US
	install -m 644 mileage.xml $(INSTALLLOC)/usr/share/osso-help/en_US/mileage.xml
	install -d $(INSTALLLOC)/usr/share/icons/hicolor/26x26/apps
	install -m 644 data/icons/26x26/mileage.png $(INSTALLLOC)/usr/share/icons/hicolor/26x26/apps/mileage.png
	install -d $(INSTALLLOC)/usr/share/icons/hicolor/48x48/apps
	install -m 644 data/icons/48x48/mileage.png $(INSTALLLOC)/usr/share/icons/hicolor/48x48/apps/mileage.png
	install -d $(INSTALLLOC)/usr/share/icons/hicolor/scalable/hildon
	install -m 644 data/icons/scalable/mileage.png $(INSTALLLOC)/usr/share/icons/hicolor/scalable/hildon/mileage.png

