15
15
libxfce4utilincludedir = $(includedir)/xfce4/libxfce4util
17
util_headers = xfce-resource.h
18
util_built_headers = util-enum-types.h
19
util_built_sources = $(util_built_headers) util-enum-types.c
17
21
libxfce4utilinclude_HEADERS = \
79
## Rules to auto-generate built sources
81
## This is a bit tricky with automake, and non-trivial to implement. The
82
## rules below seem to work fine and don't seem to break the build, but
83
## they are only enabled in maintainer mode, so arbitrary users don't get
84
## trapped in automake's oddities. Therefore we ship the autogenerated
85
## files as part of the dist tarball.
93
stamp-util-enum-types.h \
99
util-enum-types.h: stamp-util-enum-types.h
101
stamp-util-enum-types.h: $(util_headers) Makefile
102
( cd $(srcdir) && glib-mkenums \
103
--fhead "#ifndef __XFCE_UTIL_ENUM_TYPES_H__\n#define __XFCE_UTIL_ENUM_TYPES_H__\n" \
104
--fprod "/* enumerations from \"@filename@\" */\n" \
105
--vhead "GType @enum_name@_get_type (void);\n#define XFCE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
106
--ftail "#endif /* __XFCE_UTIL_ENUM_TYPES_H__ */" \
107
$(util_headers) ) > xgen-utilh \
108
&& (cmp -s xgen-utilh util-enum-types.h || cp xgen-utilh util-enum-types.h) \
109
&& rm -f xgen-utilh \
110
&& echo timestamp > $(@F)
112
util-enum-types.c: $(util_headers) Makefile
113
( cd $(srcdir) && glib-mkenums \
114
--fhead "#include <libxfce4util/libxfce4util.h>\n#include <libxfce4util/util-enum-types.h>\n" \
115
--fprod "\n/* enumerations from \"@filename@\" */" \
116
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
117
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
118
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
119
$(util_headers) ) >> xgen-utilc \
120
&& cp xgen-utilc util-enum-types.c \
72
125
pkgconfigdir = $(libdir)/pkgconfig
73
126
pkgconfig_DATA = libxfce4util-1.0.pc