Add script for creating builtin plugin list
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 23 Aug 2009 06:01:46 +0000 (23:01 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 23 Aug 2009 06:01:46 +0000 (23:01 -0700)
plugins/Makefile.am
plugins/genbuiltin [new file with mode: 0755]

index 34bc58f..8c5af9f 100644 (file)
@@ -216,19 +216,12 @@ INCLUDES = -I$(top_builddir)/include
 
 CLEANFILES = $(BUILT_SOURCES) connman.policy
 
-EXTRA_DIST = polkit.policy
+EXTRA_DIST = polkit.policy genbuiltin
 
 MAINTAINERCLEANFILES = Makefile.in
 
-builtin.h:
-       $(AM_V_at)echo "" > $@
-       $(AM_V_GEN)list='$(builtin_modules)'; for i in $$list; \
-         do echo "extern struct connman_plugin_desc __connman_builtin_$$i;" >> $@; done
-       $(AM_V_at)echo "" >> $@
-       $(AM_V_at)echo "static struct connman_plugin_desc *__connman_builtin[] = {" >> $@
-       $(AM_V_at)list='$(builtin_modules)'; for i in $$list; \
-         do echo "&__connman_builtin_$$i," >> $@; done
-       $(AM_V_at)echo "NULL };" >> $@
+builtin.h: genbuiltin $(builtin_sources)
+       $(AM_V_GEN)$(srcdir)/genbuiltin $(builtin_modules) > $@
 
 connman.policy: polkit.policy
 if POLKIT
diff --git a/plugins/genbuiltin b/plugins/genbuiltin
new file mode 100755 (executable)
index 0000000..3e1bb0c
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+for i in $*
+do
+       echo "extern struct connman_plugin_desc __connman_builtin_$i;"
+done
+
+echo
+echo "static struct connman_plugin_desc *__connman_builtin[] = {"
+
+for i in $*
+do
+       echo "  &__connman_builtin_$i,"
+done
+
+echo "  NULL"
+echo "};"