]> git.0d.be Git - empathy.git/commitdiff
Generate closures for src/
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Wed, 9 Feb 2011 16:12:32 +0000 (16:12 +0000)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Thu, 10 Feb 2011 09:24:55 +0000 (09:24 +0000)
src/Makefile.am

index 72cc541dff5e63595ae01ef0a68bc8af193bad70..d2b7f013d58dc67529c60c7450b5f9ffd74dd753 100644 (file)
@@ -84,7 +84,10 @@ libexec_PROGRAMS = \
        empathy-auth-client \
        empathy-chat
 
-BUILT_SOURCES=
+BUILT_SOURCES = \
+       src-marshal.h \
+       src-marshal.c \
+       src-marshal.list
 
 empathy_accounts_SOURCES =                                             \
        empathy-accounts.c empathy-accounts.h                           \
@@ -205,6 +208,24 @@ dist_man_MANS =                    \
        empathy.1 \
        empathy-accounts.1
 
+src-marshal.list: $(empathy_SOURCES) Makefile.am
+       $(AM_V_GEN)( cd $(srcdir) && \
+       sed -n -e 's/.*src_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
+       $(wildcard *.c) ) \
+       | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
+       @if cmp -s $@.tmp $@; then \
+               rm $@.tmp; \
+       else \
+               mv $@.tmp $@; \
+       fi
+
+%-marshal.h: %-marshal.list Makefile
+       $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+
+%-marshal.c: %-marshal.list Makefile
+       $(AM_V_GEN)echo "#include \"src-marshal.h\"" > $@ && \
+       $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+
 # rules for making the glib enum objects
 %-enumtypes.h: %.h Makefile.in
        $(AM_V_GEN)glib-mkenums \