PACKAGE = othello
PREFIX = /usr
VERSION = 0.2-2

MEMBERS = callbacks gameutils moteur deepblue support globals main

CFLAGS = `pkg-config --cflags gtk+-2.0 hildon-1`
LDFLAGS = `pkg-config --libs gtk+-2.0 hildon-1`

CFLAGS += -Os -fomit-frame-pointer

CFLAGS += -Wall
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DLOCALEDIR=\"$(PREFIX)/share/locale\"
CFLAGS += -MD

.SUFFIXES: .d

OBJS = $(patsubst %,%.o,$(MEMBERS))
DEPS = $(patsubst %,%.d,$(MEMBERS))
SOURCES = $(patsubst %,%.c,$(MEMBERS))

PIXMAPS = bell.png

all: $(PACKAGE)

$(PACKAGE): $(OBJS)
	$(CC) -o $@ $^  $(GTKLDFLAGS) $(LDFLAGS) $(PACKAGE_LDFLAGS)

install: all 
	install -D $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
	strip $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
	install -d $(DESTDIR)$(PREFIX)/share/applications
	install $(PACKAGE).desktop $(DESTDIR)$(PREFIX)/share/applications/hildon
	install $(PACKAGE).26.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/26x26/hildon/$(PACKAGE).png
	install $(PACKAGE).40.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/40x40/hildon/$(PACKAGE).png
	install $(PACKAGE).64.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/hildon/$(PACKAGE).png
	install -d $(DESTDIR)$(PREFIX)/share/$(PACKAGE)
	install -m 644 pixmaps/*.xpm $(DESTDIR)$(PREFIX)/share/$(PACKAGE)

clean:
	rm -f $(PACKAGE) $(OBJS) $(DEPS)

#include ../../base/build/Makefile.dpkg_ipkg
-include $(DEPS)
