VERSION=2.0
DESTDIR=/
CC=gcc
CFLAGS=`pkg-config --cflags --libs gconf-2.0 hildon-1 hildon-fm-2 gtk+-2.0 libosso gdk-2.0 gstreamer-controller-0.10`  -lgstinterfaces-0.10 -DTEXT_FILE=\"`echo ~/MyDocs/foo.txt`\" -Wall
EXAMPLES=\
	example_backup_server \
	example_backup_client \
	example_camera \
	example_color_selector \
	example_context \
	example_findtoolbar \
	example_file_chooser \
	example_file_details \
	example_font_selector \
	example_gconf \
	example_gtk_print_info \
	example_hard_keys \
	example_hildonprogram \
	example_libosso \
	example_menu \
	example_message \
	example_quickstart \
	example_toolbar \
	example_wavlaunch

all: $(EXAMPLES) stamp-testfile

install:
	mkdir -p $(DESTDIR)`pkg-config osso-af-settings --variable=prefix`/bin
	cp $(EXAMPLES) $(DESTDIR)`pkg-config osso-af-settings --variable=prefix`/bin
	mkdir -p $(DESTDIR)`pkg-config osso-af-settings --variable=desktopentrydir`
	cp *.desktop $(DESTDIR)`pkg-config osso-af-settings --variable=desktopentrydir`
	mkdir -p $(DESTDIR)`pkg-config osso-af-settings --variable=dbusservicedir`
	cp *.service $(DESTDIR)`pkg-config osso-af-settings --variable=dbusservicedir`

$(EXAMPLES):
	    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $@.c

clean:
	-rm -f $(EXAMPLES)
	-rm -rf stamp-*

stamp-testfile:
	-mkdir -p ~/MyDocs
	echo "Test file." > ~/MyDocs/foo.txt
	touch stamp-testfile

dist: clean
	cd .. && \
	cp -a maemo_examples maemo-examples-$(VERSION) && \
	tar czf maemo-examples-$(VERSION).tar.gz \
		maemo-examples-$(VERSION) && \
	rm -rf maemo-examples-$(VERSION)
