Initial Import
[profile/ivi/json-glib.git] / build / autotools / Makefile.am.enums
1 # Rules for generating enumeration types using glib-mkenums
2 #
3 # Define:
4 #       glib_enum_h = header template file
5 #       glib_enum_c = source template file
6 #       glib_enum_headers = list of headers to parse
7 #
8 # before including Makefile.am.enums. You will also need to have
9 # the following targets already defined:
10 #
11 #       CLEANFILES
12 #       DISTCLEANFILES
13 #       BUILT_SOURCES
14 #       EXTRA_DIST
15 #
16 # Author: Emmanuele Bassi <ebassi@linux.intel.com>
17
18 enum_tmpl_h=$(glib_enum_h:.h=.h.in)
19 enum_tmpl_c=$(glib_enum_c:.c=.c.in)
20
21 CLEANFILES += stamp-enum-types
22 DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
23 BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
24 EXTRA_DIST += $(srcdir)/$(enum_tmpl_h) $(srcdir)/$(enum_tmpl_c)
25
26 stamp-enum-types: $(glib_enum_headers) $(srcdir)/$(enum_tmpl_h)
27         $(QUIET_GEN)$(GLIB_MKENUMS) \
28                 --template $(srcdir)/$(enum_tmpl_h) \
29         $(glib_enum_headers) > xgen-eh \
30         && (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \
31         && rm -f xgen-eh \
32         && echo timestamp > $(@F)
33
34 $(glib_enum_h): stamp-enum-types
35         @true
36
37 $(glib_enum_c): $(glib_enum_h) $(srcdir)/$(enum_tmpl_c)
38         $(QUIET_GEN)$(GLIB_MKENUMS) \
39                 --template $(srcdir)/$(enum_tmpl_c) \
40         $(glib_enum_headers) > xgen-ec \
41         && cp -f xgen-ec $(glib_enum_c) \
42         && rm -f xgen-ec
43