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

3 4 5 6 7 8
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
endif

9
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
10
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
11 12 13 14 15 16
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

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

43 44 45 46
# Put the GIMP core in a lib so we can conveniently link against that
# in test cases
noinst_LIBRARIES = libapp.a

47
if ENABLE_GIMP_CONSOLE
48
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@ gimp-console-@GIMP_APP_VERSION@
49
else
50
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@
51
endif
Elliot Lee's avatar
Elliot Lee committed
52

53
libapp_sources = \
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
	about.h			\
	app.c			\
	app.h			\
	errors.c		\
	errors.h		\
	language.c		\
	language.h		\
	sanity.c		\
	sanity.h		\
	signals.c		\
	signals.h		\
	tests.c			\
	tests.h			\
	unique.c		\
	unique.h		\
	gimp-debug.c		\
	gimp-debug.h		\
71
	gimp-intl.h		\
72 73 74
	gimp-log.c		\
	gimp-log.h		\
	gimp-priorities.h	\
75 76
	gimp-version.c		\
	gimp-version.h
77

78
libapp_a_SOURCES = $(libapp_sources)
79

80
gimp_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
81

82

Ell's avatar
Ell committed
83 84 85 86
if PLATFORM_LINUX
libdl = -ldl
endif

87
if PLATFORM_OSX
88
framework_cocoa = -framework Cocoa
89 90
endif

91
if OS_WIN32
92
win32_ldflags = -mwindows -Wl,--tsaware $(WIN32_LARGE_ADDRESS_AWARE)
93

94
# for GimpDashboard and GimpBacktrace
95 96 97
psapi_cflags = -DPSAPI_VERSION=1
libpsapi = -lpsapi

98 99 100
# for GimpBacktrace
libdbghelp = -ldbghelp

101 102 103 104
if HAVE_EXCHNDL
exchndl = -lexchndl
endif

105 106
else
libm = -lm
107
endif
108

109
if USE_BINRELOC
110 111
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
endif
112

113
if HAVE_WINDRES
114
include $(top_srcdir)/build/windows/gimprc.rule
115 116
GIMPRC = gimp-$(GIMP_APP_VERSION).rc.o
GIMPCONSOLERC = gimp-console-$(GIMP_APP_VERSION).rc.o
117 118
endif

119
AM_CPPFLAGS = \
120 121 122 123 124 125 126 127 128 129 130 131 132
	-DGIMPDIR=\""$(gimpdir)"\"			\
	-DLIBEXECDIR=\""$(libexecdir)"\"		\
	-DGIMP_USER_VERSION=\"$(GIMP_USER_VERSION)\"	\
	-DGIMP_TOOL_VERSION=\"$(GIMP_TOOL_VERSION)\"	\
	-DG_LOG_DOMAIN=\"Gimp\"				\
	-DGIMP_APP_GLUE_COMPILATION			\
	-DCC_VERSION=\""$(CC_VERSION)"\"		\
	-I$(top_srcdir)					\
	$(GTK_CFLAGS)					\
	$(PANGOCAIRO_CFLAGS)				\
	$(GEGL_CFLAGS)					\
	$(LCMS_CFLAGS)					\
	$(GEXIV2_CFLAGS)				\
133
	$(psapi_cflags)					\
134
	$(xobjective_c)					\
135
	-I$(includedir)					\
136
	-I$(builddir)/gui
Elliot Lee's avatar
Elliot Lee committed
137

138 139 140
# We need this due to circular dependencies
AM_LDFLAGS = \
	$(munix)						\
141 142 143
	-Wl,-u,$(SYMPREFIX)gimp_vectors_undo_get_type		\
	-Wl,-u,$(SYMPREFIX)gimp_vectors_mod_undo_get_type	\
	-Wl,-u,$(SYMPREFIX)gimp_param_spec_duplicate		\
144 145 146 147
	-Wl,-u,$(SYMPREFIX)gimp_operations_init			\
	-Wl,-u,$(SYMPREFIX)xcf_init				\
	-Wl,-u,$(SYMPREFIX)internal_procs_init			\
	-Wl,-u,$(SYMPREFIX)gimp_plug_in_manager_restore		\
148
	-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_param_spec		\
Ell's avatar
Ell committed
149 150
	-Wl,-u,$(SYMPREFIX)gimp_layer_mode_is_legacy		\
	-Wl,-u,$(SYMPREFIX)gimp_parallel_init			\
Ell's avatar
Ell committed
151
	-Wl,-u,$(SYMPREFIX)gimp_async_set_new			\
152
	-Wl,-u,$(SYMPREFIX)gimp_uncancelable_waitable_new
153 154

gimpconsoleldadd = \
155 156 157 158 159 160 161 162 163
	xcf/libappxcf.a						\
	pdb/libappinternal-procs.a				\
	pdb/libapppdb.a						\
	plug-in/libappplug-in.a					\
	vectors/libappvectors.a					\
	core/libappcore.a					\
	file/libappfile.a					\
	text/libapptext.a					\
	paint/libapppaint.a					\
Ell's avatar
Ell committed
164
	operations/libappoperations.a				\
165 166 167 168 169 170 171 172 173 174
	operations/layer-modes/libapplayermodes.a		\
	operations/layer-modes-legacy/libapplayermodeslegacy.a	\
	gegl/libappgegl.a					\
	config/libappconfig.a					\
	$(libgimpconfig)					\
	$(libgimpmath)						\
	$(libgimpthumb)						\
	$(libgimpcolor)						\
	$(libgimpmodule)					\
	$(libgimpbase)						\
175
	$(APPSTREAM_GLIB_LIBS)					\
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
	$(GDK_PIXBUF_LIBS)					\
	$(FREETYPE_LIBS)					\
	$(FONTCONFIG_LIBS)					\
	$(PANGOCAIRO_LIBS)					\
	$(HARFBUZZ_LIBS)					\
	$(CAIRO_LIBS)						\
	$(GIO_UNIX_LIBS)					\
	$(GIO_WINDOWS_LIBS)					\
	$(GEGL_LIBS)						\
	$(GLIB_LIBS)						\
	$(LCMS_LIBS)						\
	$(GEXIV2_LIBS)						\
	$(Z_LIBS)						\
	$(JSON_C_LIBS)						\
	$(LIBMYPAINT_LIBS)					\
191
	$(LIBBACKTRACE_LIBS)					\
Ell's avatar
Ell committed
192
	$(LIBUNWIND_LIBS)					\
193 194
	$(INTLLIBS)						\
	$(RT_LIBS)						\
Ell's avatar
Ell committed
195
	$(libm)							\
196 197 198
	$(libdl)						\
	$(libpsapi)						\
	$(libdbghelp)
199

200
gimp_@GIMP_APP_VERSION@_LDFLAGS = \
201 202 203 204 205
	$(AM_LDFLAGS)						\
	$(win32_ldflags)					\
	$(framework_cocoa)					\
	-Wl,-u,$(SYMPREFIX)gimp_lebl_dialog			\
	-Wl,-u,$(SYMPREFIX)gimp_core_pixbufs_get_resource	\
206 207
	-Wl,-u,$(SYMPREFIX)gimp_tool_cursors_get_resource

208

209
gimp_@GIMP_APP_VERSION@_LDADD = \
210 211 212 213 214 215
	gui/libappgui.a			\
	menus/libappmenus.a		\
	actions/libappactions.a		\
	dialogs/libappdialogs.a		\
	tools/libapptools.a		\
	display/libappdisplay.a		\
216
	propgui/libapppropgui.a		\
217 218 219 220 221 222
	widgets/libappwidgets.a		\
	$(libgimpwidgets)		\
	$(GTK_LIBS)			\
	$(GTK_MAC_INTEGRATION_LIBS)	\
	$(DBUS_GLIB_LIBS)		\
	$(gimpconsoleldadd)		\
223
	$(exchndl)			\
224
	$(GIMPRC)
225

226

227
if ENABLE_GIMP_CONSOLE
228

229
gimp_console_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
230

231
gimp_console_@GIMP_APP_VERSION@_CPPFLAGS = \
232 233 234
	$(AM_CPPFLAGS)			\
	-DGIMP_CONSOLE_COMPILATION

235
gimp_console_@GIMP_APP_VERSION@_LDADD = \
236 237
	$(gimpconsoleldadd) \
	$(GIMPCONSOLERC)
238

239 240
endif

241

242 243 244
install-exec-hook:
if DEFAULT_BINARY
	cd $(DESTDIR)$(bindir) \
245
	&& rm -f gimp$(EXEEXT) \
246
	&& $(LN_S) gimp-$(GIMP_APP_VERSION)$(EXEEXT) gimp$(EXEEXT)
247 248 249
if ENABLE_GIMP_CONSOLE
	cd $(DESTDIR)$(bindir) \
	&& rm -f gimp-console$(EXEEXT) \
250
	&& $(LN_S) gimp-console-$(GIMP_APP_VERSION)$(EXEEXT) gimp-console$(EXEEXT)
251
endif
252 253 254 255
endif

uninstall-local:
if DEFAULT_BINARY
256
	rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
257
if ENABLE_GIMP_CONSOLE
258
	rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
259
endif
260
endif
261 262


263 264 265 266 267 268 269 270 271
# 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
272

273 274 275 276 277

# 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)
278
	./$< --dump-gimprc-system > gimprc.tmp	\
279 280 281
		&& (cmp -s gimprc.tmp $(top_srcdir)/etc/gimprc.in ||	\
		    cp gimprc.tmp $(top_srcdir)/etc/gimprc.in)		\
		&& rm gimprc.tmp
282
	./$< --dump-gimprc-manpage > gimprc.tmp	\
283 284 285
		&& (cmp -s gimprc.tmp $(top_srcdir)/docs/gimprc.5.in ||\
		    cp gimprc.tmp $(top_srcdir)/docs/gimprc.5.in)	\
		&& rm gimprc.tmp
286 287

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