Initial Import
[profile/ivi/json-glib.git] / build / autotools / Makefile.am.marshal
1 # Rules for generating marshal files using glib-genmarshal
2 #
3 # Define:
4 #       glib_marshal_list = marshal list file
5 #       glib_marshal_prefix = prefix for marshal functions
6 #
7 # before including Makefile.am.marshal. You will also need to have
8 # the following targets already defined:
9 #
10 #       CLEANFILES
11 #       DISTCLEANFILES
12 #       BUILT_SOURCES
13 #       EXTRA_DIST
14 #
15 # Author: Emmanuele Bassi <ebassi@linux.intel.com>
16
17 marshal_h = $(glib_marshal_list:.list=.h)
18 marshal_c = $(glib_marshal_list:.list=.c)
19
20 CLEANFILES += stamp-marshal
21 DISTCLEANFILES += $(marshal_h) $(marshal_c)
22 BUILT_SOURCES += $(marshal_h) $(marshal_c)
23 EXTRA_DIST += $(srcdir)/$(glib_marshal_list)
24
25 stamp-marshal: $(glib_marshal_list)
26         $(QUIET_GEN)$(GLIB_GENMARSHAL) \
27                 --prefix=$(glib_marshal_prefix) \
28                 --header \
29         $(srcdir)/$(glib_marshal_list) > xgen-mh \
30         && (cmp -s xgen-mh $(marshal_h) || cp -f xgen-mh $(marshal_h)) \
31         && rm -f xgen-mh \
32         && echo timestamp > $(@F)
33
34 $(marshal_h): stamp-marshal
35         @true
36
37 $(marshal_c): $(marshal_h)
38         $(QUIET_GEN)(echo "#include \"$(marshal_h)\"" ; \
39         $(GLIB_GENMARSHAL) \
40                 --prefix=$(glib_marshal_prefix) \
41                 --body \
42         $(srcdir)/$(glib_marshal_list)) > xgen-mc \
43         && cp xgen-mc $(marshal_c) \
44         && rm -f xgen-mc
45