summaryrefslogtreecommitdiffstats
path: root/libgimpbase/Makefile.am
blob: 4214939b09803be19510f528d06dc322262ce335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
## Process this file with automake to produce Makefile.in

if PLATFORM_WIN32
no_undefined = -no-undefined
endif

if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
framework_cocoa = -framework Cocoa
endif

if OS_WIN32
ole32_lib = -lole32
gimpbase_def = gimpbase.def
libgimpbase_export_symbols = -export-symbols $(srcdir)/gimpbase.def

install-libtool-import-lib:
	$(INSTALL) .libs/libgimpbase-$(GIMP_API_VERSION).dll.a $(DESTDIR)$(libdir)
	$(INSTALL) $(srcdir)/gimpbase.def $(DESTDIR)$(libdir)

uninstall-libtool-import-lib:
	-rm $(DESTDIR)$(libdir)/libgimpbase-$(GIMP_API_VERSION).dll.a
	-rm $(DESTDIR)$(libdir)/gimpbase.def
else
libm = -lm
install-libtool-import-lib:
uninstall-libtool-import-lib:
endif

if MS_LIB_AVAILABLE
noinst_DATA = gimpbase-$(GIMP_API_VERSION).lib

install-ms-lib:
	$(INSTALL) gimpbase-$(GIMP_API_VERSION).lib $(DESTDIR)$(libdir)

uninstall-ms-lib:
	-rm $(DESTDIR)$(libdir)/gimpbase-$(GIMP_API_VERSION).lib

gimpbase-@GIMP_API_VERSION@.lib: gimpbase.def
	lib -name:libgimpbase-$(GIMP_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gimpbase.def -out:$@

else
install-ms-lib:
uninstall-ms-lib:
endif

libgimpbaseincludedir = $(includedir)/gimp-$(GIMP_API_VERSION)/libgimpbase

AM_CPPFLAGS = \
	-DPREFIX=\""$(prefix)"\"				\
	-DGIMPDIR=\""$(gimpdir)"\"				\
	-DGIMPDATADIR=\""$(gimpdatadir)"\"				\
	-DLOCALEDIR=\""$(gimplocaledir)"\"			\
	-DPLUGINDIR=\""$(gimpplugindir)"\"			\
	-DGIMPSYSCONFDIR=\""$(gimpsysconfdir)"\"			\
	-DGIMP_PACKAGE=\""@PACKAGE@"\"				\
	-DGIMP_DATA_VERSION=\"$(GIMP_DATA_VERSION)\"		\
	-DGIMP_USER_VERSION=\"$(GIMP_USER_VERSION)\"		\
	-DGIMP_SYSCONF_VERSION=\"$(GIMP_SYSCONF_VERSION)\"	\
	-DGIMP_PLUGIN_VERSION=\"$(GIMP_PLUGIN_VERSION)\"	\
	-DG_LOG_DOMAIN=\"LibGimpBase\"				\
	-DGIMP_BASE_COMPILATION					\
	-I$(top_srcdir)						\
	$(GIO_CFLAGS)						\
	$(GEXIV2_CFLAGS)					\
	-I$(includedir)

AM_CFLAGS = \
	$(xobjective_c)

AM_CXXFLAGS = \
	$(xobjective_cxx)

AM_CCASFLAGS = \
	-I$(top_builddir)	\
	-I$(top_srcdir)

AM_LDFLAGS = \
	$(xnone)

EXTRA_DIST = \
	gimpbase.def

lib_LTLIBRARIES = libgimpbase-@GIMP_API_VERSION@.la

# help `make' along by giving another name for the file, which it knows
# how to build
../libgimpbase/gimpversion.h: gimpversion.h
	@:


libgimpbase_sources = \
	gimpbase.h		\
	gimpbaseenums.h		\
	gimpcompatenums.h	\
	gimpbasetypes.h		\
	gimpbasetypes.c		\
	gimplimits.h		\
	gimpparam.h		\
	gimpversion.h		\
	\
	gimpbase-private.c	\
	gimpbase-private.h	\
	gimpchecks.c           	\
	gimpchecks.h           	\
	gimpcpuaccel.c		\
	gimpcpuaccel.h		\
	gimpdatafiles.c		\
	gimpdatafiles.h		\
	gimpenv.c		\
	gimpenv.h		\
	gimpmemsize.c		\
	gimpmemsize.h		\
	gimpmetadata.c		\
	gimpmetadata.h		\
	gimpparasite.c		\
	gimpparasite.h		\
	gimpparasiteio.c	\
	gimpparasiteio.h	\
	gimpprotocol.c		\
	gimpprotocol.h		\
	gimprectangle.c		\
	gimprectangle.h		\
	gimpreloc.c		\
	gimpreloc.h		\
	gimpsignal.c            \
	gimpsignal.h            \
	gimpunit.c		\
	gimpunit.h		\
	gimputils.c            	\
	gimputils.h            	\
	gimpvaluearray.c	\
	gimpvaluearray.h	\
	gimpwin32-io.h		\
	gimpwire.c		\
	gimpwire.h

libgimpbase_built_sources = \
	gimpbaseenums.c		\
	gimpcompatenums.c

libgimpbase_@GIMP_API_VERSION@_la_SOURCES = \
	$(libgimpbase_sources)	\
	$(libgimpbase_built_sources)


libgimpbaseinclude_HEADERS = \
	gimpbase.h		\
	gimpbaseenums.h		\
	gimpbasetypes.h		\
	gimpcpuaccel.h		\
	gimplimits.h		\
	gimpparam.h		\
	gimpversion.h		\
	\
	gimpchecks.h		\
	gimpdatafiles.h		\
	gimpenv.h		\
	gimpmemsize.h		\
	gimpmetadata.h		\
	gimpparasite.h		\
	gimpparasiteio.h	\
	gimprectangle.h		\
	gimpsignal.h		\
	gimpunit.h		\
	gimputils.h		\
	gimpvaluearray.h

libgimpbase_@GIMP_API_VERSION@_la_LDFLAGS = \
	-version-info $(LT_VERSION_INFO)	\
	$(no_undefined) 			\
	$(libgimpbase_export_symbols)		\
	$(framework_cocoa)			\
	$(xnone)

EXTRA_libgimpbase_@GIMP_API_VERSION@_la_DEPENDENCIES = $(gimpbase_def)

libgimpbase_@GIMP_API_VERSION@_la_LIBADD = \
	$(GIO_LIBS)	\
	$(GEXIV2_LIBS)	\
	$(libm)		\
	$(ole32_lib)

install-data-local: install-ms-lib install-libtool-import-lib

uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib

#
# test programs, not to be built by default and never installed
#

TESTS = test-cpu-accel

test_cpu_accel_SOURCES = test-cpu-accel.c

test_cpu_accel_DEPENDENCIES = \
	$(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la

test_cpu_accel_LDADD = \
	$(GLIB_LIBS)	\
	$(test_cpu_accel_DEPENDENCIES)


EXTRA_PROGRAMS = test-cpu-accel


#
# rules to generate built sources
#

gen_sources = xgen-bec xgen-cec
CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)

xgen-bec: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS) Makefile.am
	$(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 \"@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@ },@if ('@valueabbrev@' ne 'NULL')@\n    /* Translators: this is an abbreviated version of @valueudesc@.\n       Keep it short. */\n    { @VALUENAME@, @valueabbrev@, NULL },@endif@" \
		--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" \
		$< > $@

# copy the generated enum file back to the source directory only if it's
# changed; otherwise, only update its timestamp, so that the recipe isn't
# executed again on the next build, however, allow this to (harmlessly) fail,
# to support building from a read-only source tree.
$(srcdir)/gimpbaseenums.c: xgen-bec
	$(AM_V_GEN) if ! cmp -s $< $@; then \
		cp $< $@; \
	else \
		touch $@ 2> /dev/null \
		|| true; \
	fi

xgen-cec: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS) Makefile.am
	$(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 \"@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@ },@if ('@valueabbrev@' ne 'NULL')@\n    /* Translators: this is an abbreviated version of @valueudesc@.\n       Keep it short. */\n    { @VALUENAME@, @valueabbrev@, NULL },@endif@" \
		--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" \
		$< > $@

# copy the generated enum file back to the source directory only if it's
# changed; otherwise, only update its timestamp, so that the recipe isn't
# executed again on the next build, however, allow this to (harmlessly) fail,
# to support building from a read-only source tree.
$(srcdir)/gimpcompatenums.c: xgen-cec
	$(AM_V_GEN) if ! cmp -s $< $@; then \
		cp $< $@; \
	else \
		touch $@ 2> /dev/null \
		|| true; \
	fi

DISTCLEANFILES = gimpversion.h