Add LED pattern helper
[led-pattern-ed] / Makefile
index 9bc5d32..96cdc74 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,16 @@
 .PHONY: all clean install
 
+bindir=/usr/bin
 pluginlibdir=`pkg-config hildon-control-panel --variable pluginlibdir`
 plugindesktopentrydir=`pkg-config hildon-control-panel --variable plugindesktopentrydir`
 
 HILDON_CFLAGS = `pkg-config --cflags hildon-1`
 OSSO_CFLAGS = `pkg-config --cflags libosso`
+GLIB_CFLAGS = `pkg-config --cflags glib-2.0 gobject-2.0`
 
 HILDON_LIBS = `pkg-config --libs hildon-1`
 OSSO_LIBS = `pkg-config --libs libosso`
+GLIB_LIBS = `pkg-config --libs glib-2.0 gobject-2.0`
 
 pluginlib_LTLIBRARY = \
        libled-pattern-editor.so
@@ -15,7 +18,10 @@ pluginlib_LTLIBRARY = \
 plugindesktopentry_DATA = \
        data/led-pattern-editor.desktop
 
-all: ${pluginlib_LTLIBRARY}
+bin_PROGRAM = \
+       led-pattern-helper
+
+all: ${pluginlib_LTLIBRARY} ${bin_PROGRAM}
 
 led_pattern_editor_SOURCES = $(patsubst %.vala,%.c,${led_pattern_editor_VALASOURCES})
 
@@ -36,12 +42,26 @@ ${pluginlib_LTLIBRARY}: ${led_pattern_editor_SOURCES}
 src/led-pattern-editor.c: ${led_pattern_editor_VALASOURCES}
        valac -C ${led_pattern_editor_VALAFLAGS} -o $@ $^
 
+led_pattern_helper_SOURCES = \
+       src/led-pattern-helper.c
+
+led_pattern_helper_VALASOURCES = \
+       src/led-pattern-helper.vala
+
+${bin_PROGRAM}: ${led_pattern_helper_SOURCES}
+       gcc ${GLIB_CFLAGS} -o $@ $^ ${GLIB_LIBS}
+
+src/led-pattern-helper.c: ${led_pattern_helper_VALASOURCES}
+       valac -C -o $@ $^
+
 clean:
-       rm ${pluginlib_LTLIBRARY} src/*.c
+       rm ${pluginlib_LTLIBRARY} ${bin_PROGRAM} src/*.c
 
 install:
        install -d ${DESTDIR}${pluginlibdir}
        install libled-pattern-editor.so ${DESTDIR}${pluginlibdir}/libled-pattern-editor.so
        install -d ${DESTDIR}${plugindesktopentrydir}
        install ${plugindesktopentry_DATA} ${DESTDIR}${plugindesktopentrydir}/`basename ${plugindesktopentry_DATA}`
+       install -d ${DESTDIR}${bindir}
+       install led-pattern-helper ${DESTDIR}${bindir}/led-pattern-helper