#
# Copyright (C) 2009 Till Harbaum <till@harbaum.org>.
#
# This file is part of zeemote-conf.
#
# zeemote-conf 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.
#
# zeemote-conf 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 zeemote-conf.  If not, see <http://www.gnu.org/licenses/>.
#

APP = zeemote-conf
PREFIX = /usr
MAEMO_VERSION_MAJOR = `pkg-config --modversion maemo-version | cut -b1 -`
PKGS = gtk+-2.0 gconf-2.0 bluez gthread-2.0 hildon-1
CFLAGS = -DHILDON -I../include `pkg-config --cflags $(PKGS)` -DMAEMO_VERSION_MAJOR=$(MAEMO_VERSION_MAJOR) -DAPP=\"$(APP)\" -O2
LDFLAGS = `pkg-config --libs $(PKGS)` -L../lib -lzeemote-conf -lzeemote -pthread 
OBJS = $(APP).o

all: lib$(APP).so

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

lib$(APP).so: $(OBJS)
	$(CC) -shared -o $@ $(OBJS) $(LDFLAGS)

install: lib$(APP).so
	install -d $(DESTDIR)$(PREFIX)/lib/hildon-control-panel
	install lib$(APP).so $(DESTDIR)$(PREFIX)/lib/hildon-control-panel

clean:
	rm -f *.o *~ lib$(APP).so $(APP)
