Commit f9fa0d1b authored by Ell's avatar Ell

enums: don't write generated enum files to src-dir if unchanged

When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
parent 7d2edec2
......@@ -132,10 +132,10 @@ CLEANFILES = $(EXTRA_PROGRAMS) foorc
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-dec
gen_sources = xgen-cec
CLEANFILES += $(gen_sources)
$(srcdir)/config-enums.c: $(srcdir)/config-enums.h $(GIMP_MKENUMS)
xgen-cec: $(srcdir)/config-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -145,7 +145,15 @@ $(srcdir)/config-enums.c: $(srcdir)/config-enums.h $(GIMP_MKENUMS)
--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) > xgen-dec \
&& cp xgen-dec $@ \
&& rm -f xgen-dec
config-enums.h) > $@
$(srcdir)/config-enums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -450,7 +450,7 @@ gimpmarshal.c: gimpmarshal.h
&& cp xgen-gmc $(@F) \
&& rm -f xgen-gmc xgen-gmc~
$(srcdir)/core-enums.c: $(srcdir)/core-enums.h $(GIMP_MKENUMS)
xgen-cec: $(srcdir)/core-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -460,6 +460,15 @@ $(srcdir)/core-enums.c: $(srcdir)/core-enums.h $(GIMP_MKENUMS)
--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) > xgen-cec \
&& cp xgen-cec $@ \
&& rm -f xgen-cec
core-enums.h) > $@
$(srcdir)/core-enums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -178,7 +178,7 @@ libappdisplay_a_SOURCES = \
gen_sources = xgen-dec
CLEANFILES = $(gen_sources)
$(srcdir)/display-enums.c: $(srcdir)/display-enums.h $(GIMP_MKENUMS)
xgen-dec: $(srcdir)/display-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -188,6 +188,15 @@ $(srcdir)/display-enums.c: $(srcdir)/display-enums.h $(GIMP_MKENUMS)
--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) > xgen-dec \
&& cp xgen-dec $@ \
&& rm -f xgen-dec
display-enums.h) > $@
$(srcdir)/display-enums.c: xgen-dec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -49,10 +49,10 @@ libappgegl_a_SOURCES = $(libappgegl_a_built_sources) $(libappgegl_a_sources)
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-tec
gen_sources = xgen-ggec
CLEANFILES = $(gen_sources)
$(srcdir)/gimp-gegl-enums.c: $(srcdir)/gimp-gegl-enums.h $(GIMP_MKENUMS)
xgen-ggec: $(srcdir)/gimp-gegl-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -62,6 +62,15 @@ $(srcdir)/gimp-gegl-enums.c: $(srcdir)/gimp-gegl-enums.h $(GIMP_MKENUMS)
--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) > xgen-tec \
&& cp xgen-tec $@ \
&& rm -f xgen-tec
gimp-gegl-enums.h) > $@
$(srcdir)/gimp-gegl-enums.c: xgen-ggec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -108,10 +108,10 @@ libappoperations_a_SOURCES = \
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-pec
gen_sources = xgen-oec
CLEANFILES = $(gen_sources)
$(srcdir)/operations-enums.c: $(srcdir)/operations-enums.h $(GIMP_MKENUMS)
xgen-oec: $(srcdir)/operations-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -121,6 +121,15 @@ $(srcdir)/operations-enums.c: $(srcdir)/operations-enums.h $(GIMP_MKENUMS)
--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) > xgen-pec \
&& cp xgen-pec $@ \
&& rm -f xgen-pec
operations-enums.h) > $@
$(srcdir)/operations-enums.c: xgen-oec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -98,7 +98,7 @@ libapppaint_a_SOURCES = $(libapppaint_a_built_sources) $(libapppaint_a_sources)
gen_sources = xgen-pec
CLEANFILES = $(gen_sources)
$(srcdir)/paint-enums.c: $(srcdir)/paint-enums.h $(GIMP_MKENUMS)
xgen-pec: $(srcdir)/paint-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -108,6 +108,15 @@ $(srcdir)/paint-enums.c: $(srcdir)/paint-enums.h $(GIMP_MKENUMS)
--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) > xgen-pec \
&& cp xgen-pec $@ \
&& rm -f xgen-pec
paint-enums.h) > $@
$(srcdir)/paint-enums.c: xgen-pec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -78,10 +78,10 @@ libappplug_in_a_SOURCES = \
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-bec
gen_sources = xgen-pec
CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)
$(srcdir)/plug-in-enums.c: $(srcdir)/plug-in-enums.h $(GIMP_MKENUMS)
xgen-pec: $(srcdir)/plug-in-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -91,6 +91,15 @@ $(srcdir)/plug-in-enums.c: $(srcdir)/plug-in-enums.h $(GIMP_MKENUMS)
--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) > xgen-bec \
&& cp xgen-bec $@ \
&& rm -f xgen-bec
plug-in-enums.h) > $@
$(srcdir)/plug-in-enums.c: xgen-pec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -57,7 +57,7 @@ libapptext_a_SOURCES = $(libapptext_a_built_sources) $(libapptext_a_sources)
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/text-enums.c: $(srcdir)/text-enums.h $(GIMP_MKENUMS)
xgen-tec: $(srcdir)/text-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -67,6 +67,15 @@ $(srcdir)/text-enums.c: $(srcdir)/text-enums.h $(GIMP_MKENUMS)
--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) > xgen-tec \
&& cp xgen-tec $@ \
&& rm -f xgen-tec
text-enums.h) > $@
$(srcdir)/text-enums.c: xgen-tec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -234,7 +234,7 @@ libapptools_a_SOURCES = $(libapptools_a_built_sources) $(libapptools_a_sources)
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/tools-enums.c: $(srcdir)/tools-enums.h $(GIMP_MKENUMS)
xgen-tec: $(srcdir)/tools-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -244,6 +244,15 @@ $(srcdir)/tools-enums.c: $(srcdir)/tools-enums.h $(GIMP_MKENUMS)
--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) > xgen-tec \
&& cp xgen-tec $@ \
&& rm -f xgen-tec
tools-enums.h) > $@
$(srcdir)/tools-enums.c: xgen-tec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -462,7 +462,7 @@ libappwidgets_a_SOURCES = \
gen_sources = xgen-wec
CLEANFILES = $(gen_sources)
$(srcdir)/widgets-enums.c: $(srcdir)/widgets-enums.h $(GIMP_MKENUMS)
xgen-wec: $(srcdir)/widgets-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -472,6 +472,15 @@ $(srcdir)/widgets-enums.c: $(srcdir)/widgets-enums.h $(GIMP_MKENUMS)
--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) > xgen-wec \
&& cp xgen-wec $@ \
&& rm -f xgen-wec
widgets-enums.h) > $@
$(srcdir)/widgets-enums.c: xgen-wec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -443,7 +443,7 @@ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
gen_sources = xgen-cec xgen-umh xgen-umc
CLEANFILES = $(gen_sources)
gimpenums.c: $(srcdir)/gimpenums.h $(srcdir)/gimpenums.c.tail $(GIMP_MKENUMS)
gimpenums.c: $(srcdir)/gimpenums.h $(srcdir)/gimpenums.c.tail $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#undef GIMP_DISABLE_DEPRECATED\n#include \"libgimpbase/gimpbase.h\"\n#include \"libgimpconfig/gimpconfigenums.h\"\n#include \"gimpenums.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
......
......@@ -201,7 +201,7 @@ EXTRA_PROGRAMS = test-cpu-accel
gen_sources = xgen-bec xgen-cec
CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)
$(srcdir)/gimpbaseenums.c: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS)
xgen-bec: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -211,11 +211,20 @@ $(srcdir)/gimpbaseenums.c: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS)
--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) > xgen-bec \
&& cp xgen-bec $@ \
&& rm -f xgen-bec
$(srcdir)/gimpcompatenums.c: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS)
gimpbaseenums.h) > $@
$(srcdir)/gimpbaseenums.c: xgen-bec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
xgen-cec: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -225,9 +234,17 @@ $(srcdir)/gimpcompatenums.c: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS)
--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) > xgen-cec \
&& cp xgen-cec $@ \
&& rm -f xgen-cec
gimpcompatenums.h) > $@
$(srcdir)/gimpcompatenums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
DISTCLEANFILES = gimpversion.h
......@@ -138,7 +138,7 @@ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
gen_sources = xgen-cec
CLEANFILES = $(gen_sources)
$(srcdir)/gimpconfigenums.c: $(srcdir)/gimpconfigenums.h $(GIMP_MKENUMS)
xgen-cec: $(srcdir)/gimpconfigenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -148,6 +148,15 @@ $(srcdir)/gimpconfigenums.c: $(srcdir)/gimpconfigenums.h $(GIMP_MKENUMS)
--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) > xgen-cec \
&& cp xgen-cec $@ \
&& rm -f xgen-cec
gimpconfigenums.h) > $@
$(srcdir)/gimpconfigenums.c: xgen-cec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
......@@ -111,7 +111,7 @@ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
gimpthumb-enums.c: $(srcdir)/gimpthumb-enums.h $(GIMP_MKENUMS)
gimpthumb-enums.c: $(srcdir)/gimpthumb-enums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) $(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"gimpthumb-enums.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
......
......@@ -307,7 +307,7 @@ endif
gen_sources = xgen-wec xgen-wmh xgen-wmc
CLEANFILES = $(gen_sources)
$(srcdir)/gimpwidgetsenums.c: $(srcdir)/gimpwidgetsenums.h $(GIMP_MKENUMS)
xgen-wec: $(srcdir)/gimpwidgetsenums.h $(GIMP_MKENUMS) Makefile.am
$(AM_V_GEN) (cd $(srcdir) && $(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@\" */" \
......@@ -317,9 +317,18 @@ $(srcdir)/gimpwidgetsenums.c: $(srcdir)/gimpwidgetsenums.h $(GIMP_MKENUMS)
--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) > xgen-wec \
&& cp xgen-wec $@ \
&& rm -f xgen-wec
gimpwidgetsenums.h) > $@
$(srcdir)/gimpwidgetsenums.c: xgen-wec
$(AM_V_GEN) if ! cmp -s $< $@; then \
cp $< $@; \
else \
# if the file hasn't changed, only update its timestamp, so that \
# the receipe doesn't get executed again next time, but allow this \
# to fail (e.g., when using a read-only source directory). \
touch $@ 2> /dev/null \
|| true; \
fi
gimpwidgetsmarshal.h: $(srcdir)/gimpwidgetsmarshal.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gimp_widgets_marshal $(srcdir)/gimpwidgetsmarshal.list --header >> xgen-wmh \
......
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