Makefile.am 7.52 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1
2
## Process this file with automake to produce Makefile.in

3
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
4
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
5
6
7
8
9
10
libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la

11
# Sort this by architectural dependencies, lowest level at the top,
12
13
# so that when e.g. changing a header-file the subdirs are built in
# the right order
14
SUBDIRS = \
15
	base		\
16
	paint-funcs	\
17
18
19
	config		\
	composite	\
	core		\
20
21
	gegl		\
	text		\
22
23
	vectors		\
	paint		\
24
	plug-in		\
25
	xcf		\
26
27
28
29
30
31
32
33
34
	file		\
	pdb		\
	widgets		\
	display		\
	tools		\
	dialogs		\
	actions		\
	menus		\
	gui		\
Michael Natterer's avatar
Michael Natterer committed
35
	.		\
36
	tests
Elliot Lee's avatar
Elliot Lee committed
37

38
39
40
41
# Put the GIMP core in a lib so we can conveniently link against that
# in test cases
noinst_LIBRARIES = libapp.a

42
if ENABLE_GIMP_CONSOLE
43
bin_PROGRAMS = gimp-2.7 gimp-console-2.7
44
else
45
bin_PROGRAMS = gimp-2.7
46
endif
Elliot Lee's avatar
Elliot Lee committed
47

48
libapp_sources = \
49
	about.h		\
Sven Neumann's avatar
Sven Neumann committed
50
51
	app.c		\
	app.h		\
52
53
54
55
	batch.c		\
	batch.h		\
	errors.c	\
	errors.h	\
56
57
	sanity.c	\
	sanity.h	\
58
59
	signals.c	\
	signals.h	\
60
61
	tests.c		\
	tests.h		\
62
63
	unique.c	\
	unique.h	\
64
65
	units.c		\
	units.h		\
66
67
	version.c	\
	version.h	\
68
69
	gimp-debug.c	\
	gimp-debug.h	\
70
71
	gimp-log.c	\
	gimp-log.h	\
72
	gimp-intl.h
73

74
75
76
libapp_generated_sources = \
	git-version.h

77
78
79
80
# Build git-version.h before anything in the subdirs as this is needed
# in the about dialog.
BUILT_SOURCES = $(libapp_generated_sources)

Martin Nordholts's avatar
Martin Nordholts committed
81
82
CLEANFILES = $(libapp_generated_sources)

83
84
85
$(srcdir)/version.c: git-version.h

libapp_a_SOURCES = $(libapp_sources) $(libapp_generated_sources)
86
87

gimp_2_7_SOURCES = $(libapp_sources) main.c
88

89

Elliot Lee's avatar
Elliot Lee committed
90
EXTRA_DIST = \
91
	makefile.msc
92

93
if OS_WIN32
94
win32_ldflags = -mwindows $(WIN32_LARGE_ADDRESS_AWARE)
95
endif
96

97
if USE_BINRELOC
98
99
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
endif
100

101
if HAVE_WINDRES
102
include $(top_srcdir)/build/windows/gimprc.rule
103
104
GIMPRC = gimp-$(GIMP_APP_VERSION).rc.o
GIMPCONSOLERC = gimp-console-$(GIMP_APP_VERSION).rc.o
105
106
endif

107
AM_CPPFLAGS = \
108
	-DG_LOG_DOMAIN=\"Gimp\"		\
109
	-DGIMP_APP_GLUE_COMPILATION
Elliot Lee's avatar
Elliot Lee committed
110

111
INCLUDES = \
112
113
	-I$(top_srcdir)		\
	$(GTK_CFLAGS)		\
114
	$(PANGOCAIRO_CFLAGS)	\
115
	$(DBUS_GLIB_CFLAGS)	\
Sven Neumann's avatar
Sven Neumann committed
116
	$(GEGL_CFLAGS)		\
117
	-I$(includedir)
Elliot Lee's avatar
Elliot Lee committed
118

119
120
121
122
123
124
# FIXME: core should not depend on xcf
workaround_that_core_depends_on_xcf = \
	-u $(SYMPREFIX)xcf_init

# FIXME: core should not depend on pdb
workaround_that_core_depends_on_pdb = \
125
	-u $(SYMPREFIX)internal_procs_init		\
126
	-u $(SYMPREFIX)gimp_plug_in_manager_restore
127

128
129
130
# FIXME: plug-in should not depend on pdb
workaround_that_plug_in_depends_on_pdb = \
	-u $(SYMPREFIX)gimp_pdb_compat_param_spec
131

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# FIXME: file should not depend on plug-in
workaround_that_file_depends_on_plug_in = \
	-u $(SYMPREFIX)plug_in_icc_profile_apply_rgb	\
	-u $(SYMPREFIX)gimp_image_map_config_get_type

# core, vectors and gegl are on the same architectural layer, prevent
# the linker from panicing
calm_down_linker = \
	-u $(SYMPREFIX)gimp_vectors_undo_get_type	\
	-u $(SYMPREFIX)gimp_vectors_mod_undo_get_type	\
	-u $(SYMPREFIX)gimp_vectors_prop_undo_get_type	\
	-u $(SYMPREFIX)gimp_curve_map_pixels

AM_LDFLAGS = \
	$(munix)					\
	$(CARBON_LDFLAGS)				\
	$(calm_down_linker)				\
	$(workaround_that_core_depends_on_xcf)		\
	$(workaround_that_core_depends_on_pdb)		\
	$(workaround_that_plug_in_depends_on_pdb)	\
	$(workaround_that_file_depends_on_plug_in)

gimpconsoleldadd = \
155
	xcf/libappxcf.a			\
156
	pdb/libappinternal-procs.a	\
157
	pdb/libapppdb.a			\
158
	plug-in/libappplug-in.a		\
159
	vectors/libappvectors.a		\
160
161
	core/libappcore.a		\
	file/libappfile.a		\
162
	text/libapptext.a		\
163
164
	paint/libapppaint.a		\
	composite/libappcomposite.a	\
Michael Natterer's avatar
Michael Natterer committed
165
	gegl/libappgegl.a		\
166
	config/libappconfig.a		\
167
168
	paint-funcs/libapppaint-funcs.a	\
	base/libappbase.a		\
169
	$(libgimpconfig)		\
170
171
172
173
	$(libgimpmath)			\
	$(libgimpthumb)			\
	$(libgimpcolor)			\
	$(libgimpmodule)		\
174
	$(libgimpbase)			\
175
	$(GDK_PIXBUF_LIBS)		\
176
	$(FREETYPE_LIBS)		\
177
178
179
	$(FONTCONFIG_LIBS)		\
	$(PANGOCAIRO_LIBS)		\
	$(CAIRO_LIBS)			\
Sven Neumann's avatar
Sven Neumann committed
180
	$(GEGL_LIBS)			\
181
	$(GLIB_LIBS)			\
182
	$(INTLLIBS)			\
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
	$(RT_LIBS)

gimp_2_7_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags)

gimp_2_7_LDADD = \
	gui/libappgui.a		\
	menus/libappmenus.a	\
	actions/libappactions.a	\
	dialogs/libappdialogs.a	\
	tools/libapptools.a	\
	display/libappdisplay.a	\
	widgets/libappwidgets.a	\
	$(libgimpwidgets)	\
	$(GTK_LIBS)		\
	$(DBUS_GLIB_LIBS)	\
198
199
	$(gimpconsoleldadd)	\
	$(GIMPRC)
200

201

202
if ENABLE_GIMP_CONSOLE
203

204
gimp_console_2_7_SOURCES = $(libapp_sources) main.c
205

206
gimp_console_2_7_CPPFLAGS = \
207
208
209
	$(AM_CPPFLAGS)			\
	-DGIMP_CONSOLE_COMPILATION

210
gimp_console_2_7_LDADD = \
211
212
	$(gimpconsoleldadd) \
	$(GIMPCONSOLERC)
213

214
215
endif

216

217
218
219
install-exec-hook:
if DEFAULT_BINARY
	cd $(DESTDIR)$(bindir) \
220
	&& rm -f gimp$(EXEEXT) \
221
	&& $(LN_S) gimp-$(GIMP_APP_VERSION)$(EXEEXT) gimp$(EXEEXT)
222
223
224
if ENABLE_GIMP_CONSOLE
	cd $(DESTDIR)$(bindir) \
	&& rm -f gimp-console$(EXEEXT) \
225
	&& $(LN_S) gimp-console-$(GIMP_APP_VERSION)$(EXEEXT) gimp-console$(EXEEXT)
226
endif
227
228
229
230
endif

uninstall-local:
if DEFAULT_BINARY
231
	rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
232
if ENABLE_GIMP_CONSOLE
233
	rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
234
endif
235
endif
236
237


238
239
240
241
242
243
244
245
246
# require gimp-console when making dist
#
if ENABLE_GIMP_CONSOLE
dist-check-gimp-console:
else
dist-check-gimp-console:
	@echo "*** gimp-console must be enabled in order to make dist"
	@false
endif
247

248
249
250
251
252

# hook to assure that the system gimprc and the gimprc manpage are
# uptodate when a release is made
#
dist-dump-gimprc: gimp-console-$(GIMP_APP_VERSION)$(EXEEXT)
Sven Neumann's avatar
Sven Neumann committed
253
	./$< --dump-gimprc-system > gimprc.tmp	\
Michael Natterer's avatar
Michael Natterer committed
254
255
256
257
258
		&& sed -e "s/num-processors [0-9]*/num-processors 1/"	\
		   gimprc.tmp > gimprc.tmp2				\
		&& (cmp -s gimprc.tmp2 $(top_srcdir)/etc/gimprc ||	\
		    cp gimprc.tmp2 $(top_srcdir)/etc/gimprc)		\
		&& rm gimprc.tmp gimprc.tmp2
Sven Neumann's avatar
Sven Neumann committed
259
	./$< --dump-gimprc-manpage > gimprc.tmp	\
Michael Natterer's avatar
Michael Natterer committed
260
261
262
263
264
		&& sed -e "s/num-processors [0-9]*/num-processors 1/"	\
		   gimprc.tmp > gimprc.tmp2				\
		&& (cmp -s gimprc.tmp2 $(top_srcdir)/docs/gimprc.5.in ||\
		    cp gimprc.tmp2 $(top_srcdir)/docs/gimprc.5.in)	\
		&& rm gimprc.tmp gimprc.tmp2
265
266

dist-hook: dist-check-gimp-console dist-dump-gimprc
267

268
# If git is available, always check if git-version.h should be
Mukund Sivaraman's avatar
Mukund Sivaraman committed
269
# updated. If git is not available, don't do anything if git-version.h
270
271
272
273
# already exists because then we are probably working with a tarball
# in which case the git-version.h we ship is correct.
git-version.h: update-git-version-header
	@if test -d "$(top_srcdir)/.git"; then \
274
275
276
	  git_version="`git describe`"; \
	  git_last_commit_timestamp="`git log -n1 --reverse --pretty=%ct`"; \
	  git_last_commit_year="`date --utc -d \"1970-01-01 + $$git_last_commit_timestamp seconds\" '+%Y'`"; \
277
	elif test ! -f "$@"; then \
278
279
280
281
282
283
284
285
286
287
288
	  git_version="Unknown, shouldn't happen"; \
	  git_last_commit_timestamp=-1; \
	  git_last_commit_year="`date --utc '+%Y'`"; \
	fi; \
	echo "#ifndef __GIT_VERSION_H__" > "$@.tmp"; \
	echo "#define __GIT_VERSION_H__" >> "$@.tmp"; \
	echo "#include <time.h>" >> "$@.tmp"; \
	echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$@.tmp"; \
	echo "#define GIMP_GIT_LAST_COMMIT_TIMESTAMP ((time_t)$$git_last_commit_timestamp)" >> "$@.tmp"; \
	echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$@.tmp"; \
	echo "#endif /* __GIT_VERSION_H__ */" >> "$@.tmp"
289
	@if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \
290
291
292
	  rm -f "$@.tmp"; \
	elif test -f "$@.tmp"; then \
	  mv "$@.tmp" "$@"; \
293
	  echo "  git HEAD changed: $@ regenerated"; \
294
295
296
	fi

.PHONY: update-git-version-header