Use script to generate list of builtin plugin symbols

This commit is contained in:
Marcel Holtmann 2009-08-24 19:05:41 -07:00
parent d9a2bb1337
commit 7d3d52009d
4 changed files with 24 additions and 19 deletions

View File

@ -43,12 +43,6 @@ CLEANFILES = $(BUILT_SOURCES)
MAINTAINERCLEANFILES = Makefile.in
builtin.h:
echo "" > $@
list='$(builtin_modules)'; for i in $$list; \
do echo "extern struct ofono_plugin_desc __ofono_builtin_$$i;" >> $@; done
echo "" >> $@
echo "static struct ofono_plugin_desc *__ofono_drivers[] = {" >> $@
list='$(builtin_modules)'; for i in $$list; \
do echo "&__ofono_builtin_$$i," >> $@; done
echo "NULL };" >> $@
builtin.h: $(top_srcdir)/src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(top_srcdir)/src/genbuiltin $(builtin_modules) | \
$(SED) -e "s/builtin\[\]/drivers\[\]/" > $@

View File

@ -30,12 +30,6 @@ CLEANFILES = $(BUILT_SOURCES)
MAINTAINERCLEANFILES = Makefile.in
builtin.h:
echo "" > $@
list='$(builtin_modules)'; for i in $$list; \
do echo "extern struct ofono_plugin_desc __ofono_builtin_$$i;" >> $@; done
echo "" >> $@
echo "static struct ofono_plugin_desc *__ofono_plugins[] = {" >> $@
list='$(builtin_modules)'; for i in $$list; \
do echo "&__ofono_builtin_$$i," >> $@; done
echo "NULL };" >> $@
builtin.h: $(top_srcdir)/src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(top_srcdir)/src/genbuiltin $(builtin_modules) | \
$(SED) -e "s/builtin\[\]/plugins\[\]/" > $@

View File

@ -40,7 +40,7 @@ AM_CFLAGS = @GTHREAD_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @GATCHAT_CFLAGS@ \
INCLUDES = -I$(top_builddir)/include -I$(top_builddir)
EXTRA_DIST = ofono.conf
EXTRA_DIST = genbuiltin ofono.conf
MAINTAINERCLEANFILES = Makefile.in

17
src/genbuiltin Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
for i in $*
do
echo "extern struct ofono_plugin_desc __ofono_builtin_$i;"
done
echo
echo "static struct ofono_plugin_desc *__ofono_builtin[] = {"
for i in $*
do
echo " &__ofono_builtin_$i,"
done
echo " NULL"
echo "};"