1## Process this file with automake to produce Makefile.in
2
3libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
4libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
5libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
6libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
7libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
8libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
9
10if OS_WIN32
11else
12libm = -lm
13endif
14
15AM_CPPFLAGS = \
16	-DG_LOG_DOMAIN=\"Gimp-Config\"				\
17	-DGIMP_APP_VERSION_STRING=\"$(GIMP_APP_VERSION)\"	\
18	-I$(top_builddir)					\
19	-I$(top_srcdir)						\
20	-I$(top_builddir)/app					\
21	-I$(top_srcdir)/app					\
22	$(GIO_UNIX_CFLAGS)					\
23	$(GIO_WINDOWS_CFLAGS)					\
24	$(GEGL_CFLAGS)						\
25	$(CAIRO_CFLAGS)						\
26	$(GDK_PIXBUF_CFLAGS)					\
27	$(MYPAINT_BRUSHES_CFLAGS)				\
28	-I$(includedir)
29
30noinst_LIBRARIES = libappconfig.a
31
32libappconfig_a_sources = \
33	config-enums.h			\
34	config-types.h			\
35	gimpconfig-dump.c		\
36	gimpconfig-dump.h		\
37	gimpconfig-file.c		\
38	gimpconfig-file.h		\
39	gimpconfig-utils.c		\
40	gimpconfig-utils.h		\
41	gimpcoreconfig.c		\
42	gimpcoreconfig.h		\
43	gimpdialogconfig.c		\
44	gimpdialogconfig.h		\
45	gimpdisplayconfig.c		\
46	gimpdisplayconfig.h		\
47	gimpdisplayoptions.c		\
48	gimpdisplayoptions.h		\
49	gimpgeglconfig.c		\
50	gimpgeglconfig.h		\
51	gimpguiconfig.c			\
52	gimpguiconfig.h			\
53	gimplangrc.c			\
54	gimplangrc.h			\
55	gimppluginconfig.c		\
56	gimppluginconfig.h		\
57	gimprc.c			\
58	gimprc.h			\
59	gimprc-blurbs.h			\
60	gimprc-deserialize.c		\
61	gimprc-deserialize.h		\
62	gimprc-serialize.c		\
63	gimprc-serialize.h		\
64	gimprc-unknown.c		\
65	gimprc-unknown.h		\
66	gimpxmlparser.c			\
67	gimpxmlparser.h
68
69libappconfig_a_built_sources = \
70	config-enums.c
71
72libappconfig_a_SOURCES = \
73	$(libappconfig_a_built_sources)	\
74	$(libappconfig_a_sources)
75
76EXTRA_PROGRAMS = test-config
77
78#
79# unit tests for the GimpConfig system
80#
81
82TESTS = test-config
83
84test_config_DEPENDENCIES = $(gimpconfig_libs)
85
86# We need this due to circular dependencies
87test_config_LDFLAGS = \
88	-Wl,-u,$(SYMPREFIX)gimp_vectors_undo_get_type		\
89	-Wl,-u,$(SYMPREFIX)gimp_vectors_mod_undo_get_type	\
90	-Wl,-u,$(SYMPREFIX)gimp_param_spec_duplicate		\
91	-Wl,-u,$(SYMPREFIX)xcf_init				\
92	-Wl,-u,$(SYMPREFIX)internal_procs_init			\
93	-Wl,-u,$(SYMPREFIX)gimp_plug_in_manager_restore		\
94	-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_param_spec		\
95	-Wl,-u,$(SYMPREFIX)gimp_layer_mode_is_legacy		\
96	-Wl,-u,$(SYMPREFIX)gimp_async_set_new			\
97	-Wl,-u,$(SYMPREFIX)gimp_uncancelable_waitable_new
98
99test_config_LDADD = \
100	../xcf/libappxcf.a						\
101	../pdb/libappinternal-procs.a					\
102	../pdb/libapppdb.a						\
103	../plug-in/libappplug-in.a					\
104	../vectors/libappvectors.a					\
105	../core/libappcore.a						\
106	../file/libappfile.a						\
107	../file-data/libappfile-data.a					\
108	../text/libapptext.a						\
109	../paint/libapppaint.a						\
110	../gegl/libappgegl.a						\
111	../operations/libappoperations.a				\
112	../operations/layer-modes/libapplayermodes.a			\
113	../operations/layer-modes-legacy/libapplayermodeslegacy.a	\
114	libappconfig.a							\
115	../gimp-debug.o							\
116	../gimp-log.o							\
117	$(libgimpmodule)						\
118	$(libgimpcolor)							\
119	$(libgimpthumb)							\
120	$(libgimpmath)							\
121	$(libgimpconfig)						\
122	$(libgimpbase)							\
123	$(PANGOCAIRO_LIBS)						\
124	$(HARFBUZZ_LIBS)						\
125	$(GDK_PIXBUF_LIBS)						\
126	$(GEGL_LIBS)							\
127	$(GIO_LIBS)							\
128	$(GEXIV2_LIBS)							\
129	$(Z_LIBS)							\
130	$(JSON_C_LIBS)							\
131	$(LIBMYPAINT_LIBS)						\
132	$(libm)
133
134CLEANFILES = $(EXTRA_PROGRAMS) foorc
135
136#
137# rules to generate built sources
138#
139# setup autogeneration dependencies
140gen_sources = xgen-cec
141CLEANFILES += $(gen_sources)
142
143xgen-cec: $(srcdir)/config-enums.h $(GIMP_MKENUMS) Makefile.am
144	$(AM_V_GEN) $(GIMP_MKENUMS) \
145		--fhead "#include \"config.h\"\n#include <gio/gio.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"config-enums.h\"\n#include\"gimp-intl.h\"" \
146		--fprod "\n/* enumerations from \"@basename@\" */" \
147		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static const G@Type@Value values[] =\n  {" \
148		--vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
149		--vtail "    { 0, NULL, NULL }\n  };\n" \
150		--dhead "  static const Gimp@Type@Desc descs[] =\n  {" \
151		--dprod "    { @VALUENAME@, @valuedesc@, @valuehelp@ },@if ('@valueabbrev@' ne 'NULL')@\n    /* Translators: this is an abbreviated version of @valueudesc@.\n       Keep it short. */\n    { @VALUENAME@, @valueabbrev@, NULL },@endif@" \
152		--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" \
153		$< > $@
154
155# copy the generated enum file back to the source directory only if it's
156# changed; otherwise, only update its timestamp, so that the recipe isn't
157# executed again on the next build, however, allow this to (harmlessly) fail,
158# to support building from a read-only source tree.
159$(srcdir)/config-enums.c: xgen-cec
160	$(AM_V_GEN) if ! cmp -s $< $@; then \
161		cp $< $@; \
162	else \
163		touch $@ 2> /dev/null \
164		|| true; \
165	fi
166