Commit 5bcde32c authored by Ell's avatar Ell

enums: run gimp-mkenums from the build dir

Commit 1e6acbd4 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
parent f9fa0d1b
......@@ -136,16 +136,16 @@ gen_sources = xgen-cec
CLEANFILES += $(gen_sources)
xgen-cec: $(srcdir)/config-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"config-enums.h\"\n#include\"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
config-enums.h) > $@
$< > $@
$(srcdir)/config-enums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -451,16 +451,16 @@ gimpmarshal.c: gimpmarshal.h
&& rm -f xgen-gmc xgen-gmc~
xgen-cec: $(srcdir)/core-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"core-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
core-enums.h) > $@
$< > $@
$(srcdir)/core-enums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -179,16 +179,16 @@ gen_sources = xgen-dec
CLEANFILES = $(gen_sources)
xgen-dec: $(srcdir)/display-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"display-enums.h\"\n#include\"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
display-enums.h) > $@
$< > $@
$(srcdir)/display-enums.c: xgen-dec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -53,16 +53,16 @@ gen_sources = xgen-ggec
CLEANFILES = $(gen_sources)
xgen-ggec: $(srcdir)/gimp-gegl-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"core/core-enums.h\"\n#include \"gimp-gegl-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
gimp-gegl-enums.h) > $@
$< > $@
$(srcdir)/gimp-gegl-enums.c: xgen-ggec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -112,16 +112,16 @@ gen_sources = xgen-oec
CLEANFILES = $(gen_sources)
xgen-oec: $(srcdir)/operations-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"operations-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
operations-enums.h) > $@
$< > $@
$(srcdir)/operations-enums.c: xgen-oec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -99,16 +99,16 @@ gen_sources = xgen-pec
CLEANFILES = $(gen_sources)
xgen-pec: $(srcdir)/paint-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"paint-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
paint-enums.h) > $@
$< > $@
$(srcdir)/paint-enums.c: xgen-pec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -82,16 +82,16 @@ gen_sources = xgen-pec
CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)
xgen-pec: $(srcdir)/plug-in-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"plug-in-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
plug-in-enums.h) > $@
$< > $@
$(srcdir)/plug-in-enums.c: xgen-pec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -58,16 +58,16 @@ gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
xgen-tec: $(srcdir)/text-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"text-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
text-enums.h) > $@
$< > $@
$(srcdir)/text-enums.c: xgen-tec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -235,16 +235,16 @@ gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
xgen-tec: $(srcdir)/tools-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"core/core-enums.h\"\n#include \"tools-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
tools-enums.h) > $@
$< > $@
$(srcdir)/tools-enums.c: xgen-tec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -463,16 +463,16 @@ gen_sources = xgen-wec
CLEANFILES = $(gen_sources)
xgen-wec: $(srcdir)/widgets-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gtk/gtk.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"widgets-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
widgets-enums.h) > $@
$< > $@
$(srcdir)/widgets-enums.c: xgen-wec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -453,7 +453,7 @@ gimpenums.c: $(srcdir)/gimpenums.h $(srcdir)/gimpenums.c.tail $(GIMP_MKENUMS) Ma
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/gimpenums.h > xgen-cec \
$< > xgen-cec \
&& cat $(srcdir)/gimpenums.c.tail >> xgen-cec \
&& cp xgen-cec $(@F) \
&& rm -f xgen-cec
......
......@@ -202,16 +202,16 @@ gen_sources = xgen-bec xgen-cec
CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)
xgen-bec: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#undef GIMP_DISABLE_DEPRECATED\n#include \"gimpbasetypes.h\"\n#include \"libgimp/libgimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
gimpbaseenums.h) > $@
$< > $@
$(srcdir)/gimpbaseenums.c: xgen-bec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......@@ -225,16 +225,16 @@ $(srcdir)/gimpbaseenums.c: xgen-bec
fi
xgen-cec: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"gimpbasetypes.h\"\n#include \"gimpcompatenums.h\"\n#include \"libgimp/libgimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
gimpcompatenums.h) > $@
$< > $@
$(srcdir)/gimpcompatenums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -139,16 +139,16 @@ gen_sources = xgen-cec
CLEANFILES = $(gen_sources)
xgen-cec: $(srcdir)/gimpconfigenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"gimpconfigenums.h\"\n#include \"libgimp/libgimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
gimpconfigenums.h) > $@
$< > $@
$(srcdir)/gimpconfigenums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -118,6 +118,6 @@ gimpthumb-enums.c: $(srcdir)/gimpthumb-enums.h $(GIMP_MKENUMS) Makefile.am
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\n" \
$(srcdir)/gimpthumb-enums.h > xgen-tec \
$< > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec
......@@ -308,16 +308,16 @@ gen_sources = xgen-wec xgen-wmh xgen-wmc
CLEANFILES = $(gen_sources)
xgen-wec: $(srcdir)/gimpwidgetsenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(GIMP_MKENUMS) \
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"gimpwidgetsenums.h\"\n#include \"libgimp/libgimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n/* enumerations from \"@basename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n" \
--dhead " static const Gimp@Type@Desc descs[] =\n {" \
--dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \
--dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
gimpwidgetsenums.h) > $@
$< > $@
$(srcdir)/gimpwidgetsenums.c: xgen-wec
$(AM_V_GEN) if ! cmp -s $< $@; then \
......
......@@ -9,6 +9,7 @@
# value is by default put into the N_() macro.
use Text::ParseWords;
use File::Basename;
# gimp-mkenums
# Information about the current enumeration
......@@ -178,6 +179,7 @@ sub usage {
print STDERR " \@Type\@ either Enum or Flags\n";
print STDERR " \@TYPE\@ either ENUM or FLAGS\n";
print STDERR " \@filename\@ name of current input file\n";
print STDERR " \@basename\@ basename of current input file\n";
exit 0;
}
......@@ -228,6 +230,7 @@ if (length($fhead)) {
my $prod = $fhead;
$prod =~ s/\@filename\@/$ARGV[0]/g;
$prod =~ s/\@basename\@/basename($ARGV[0])/ge;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
......@@ -376,6 +379,7 @@ while (<>) {
my $prod = $fprod;
$prod =~ s/\@filename\@/$ARGV/g;
$prod =~ s/\@basename\@/basename($ARGV)/ge;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
......@@ -516,6 +520,7 @@ if (length($ftail)) {
my $prod = $ftail;
$prod =~ s/\@filename\@/$ARGV/g;
$prod =~ s/\@basename\@/basename($ARGV)/ge;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment