Makefile.am 7.39 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

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

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

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

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

75
76
77
libapp_generated_sources = \
	git-version.h

Martin Nordholts's avatar
Martin Nordholts committed
78
79
CLEANFILES = $(libapp_generated_sources)

80
81
82
$(srcdir)/version.c: git-version.h

libapp_a_SOURCES = $(libapp_sources) $(libapp_generated_sources)
83
84

gimp_2_7_SOURCES = $(libapp_sources) main.c
85

86

Elliot Lee's avatar
Elliot Lee committed
87
EXTRA_DIST = \
88
	makefile.msc
89

90
if OS_WIN32
91
win32_ldflags = -mwindows $(WIN32_LARGE_ADDRESS_AWARE)
92
endif
93

94
if USE_BINRELOC
95
96
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
endif
97

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

104
AM_CPPFLAGS = \
105
	-DG_LOG_DOMAIN=\"Gimp\"		\
106
	-DGIMP_APP_GLUE_COMPILATION
Elliot Lee's avatar
Elliot Lee committed
107

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

116
117
118
119
120
121
# 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 = \
122
	-u $(SYMPREFIX)internal_procs_init		\
123
	-u $(SYMPREFIX)gimp_plug_in_manager_restore
124

125
126
127
# FIXME: plug-in should not depend on pdb
workaround_that_plug_in_depends_on_pdb = \
	-u $(SYMPREFIX)gimp_pdb_compat_param_spec
128

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# 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 = \
152
	xcf/libappxcf.a			\
153
	pdb/libappinternal-procs.a	\
154
	pdb/libapppdb.a			\
155
	plug-in/libappplug-in.a		\
156
	vectors/libappvectors.a		\
157
158
	core/libappcore.a		\
	file/libappfile.a		\
159
	text/libapptext.a		\
160
161
	paint/libapppaint.a		\
	composite/libappcomposite.a	\
Michael Natterer's avatar
Michael Natterer committed
162
	gegl/libappgegl.a		\
163
	config/libappconfig.a		\
164
165
	paint-funcs/libapppaint-funcs.a	\
	base/libappbase.a		\
166
	$(libgimpconfig)		\
167
168
169
170
	$(libgimpmath)			\
	$(libgimpthumb)			\
	$(libgimpcolor)			\
	$(libgimpmodule)		\
171
	$(libgimpbase)			\
172
	$(GDK_PIXBUF_LIBS)		\
173
	$(FREETYPE_LIBS)		\
174
175
176
	$(FONTCONFIG_LIBS)		\
	$(PANGOCAIRO_LIBS)		\
	$(CAIRO_LIBS)			\
Sven Neumann's avatar
Sven Neumann committed
177
	$(GEGL_LIBS)			\
178
	$(GLIB_LIBS)			\
179
	$(INTLLIBS)			\
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
	$(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)	\
195
196
	$(gimpconsoleldadd)	\
	$(GIMPRC)
197

198

199
if ENABLE_GIMP_CONSOLE
200

201
gimp_console_2_7_SOURCES = $(libapp_sources) main.c
202

203
gimp_console_2_7_CPPFLAGS = \
204
205
206
	$(AM_CPPFLAGS)			\
	-DGIMP_CONSOLE_COMPILATION

207
gimp_console_2_7_LDADD = \
208
209
	$(gimpconsoleldadd) \
	$(GIMPCONSOLERC)
210

211
212
endif

213

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

uninstall-local:
if DEFAULT_BINARY
228
	rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
229
if ENABLE_GIMP_CONSOLE
230
	rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
231
endif
232
endif
233
234


235
236
237
238
239
240
241
242
243
# 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
244

245
246
247
248
249

# 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
250
	./$< --dump-gimprc-system > gimprc.tmp	\
Michael Natterer's avatar
Michael Natterer committed
251
252
253
254
255
		&& 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
256
	./$< --dump-gimprc-manpage > gimprc.tmp	\
Michael Natterer's avatar
Michael Natterer committed
257
258
259
260
261
		&& 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
262
263

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

265
# If git is available, always check if git-version.h should be
Mukund Sivaraman's avatar
Mukund Sivaraman committed
266
# updated. If git is not available, don't do anything if git-version.h
267
268
269
270
# 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 \
271
272
273
	  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'`"; \
274
	elif test ! -f "$@"; then \
275
276
277
278
279
280
281
282
283
284
285
	  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"
286
	@if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \
287
288
289
	  rm -f "$@.tmp"; \
	elif test -f "$@.tmp"; then \
	  mv "$@.tmp" "$@"; \
290
	  echo "  git HEAD changed: $@ regenerated"; \
291
292
293
	fi

.PHONY: update-git-version-header