1# Flag build for parallelism; see https://savannah.gnu.org/patch/?6905
2.AUTOPARALLEL:
3
4lib_LTLIBRARIES = libmuffin.la
5
6SUBDIRS=wm-tester tools compositor/plugins
7
8NULL =
9
10AM_CPPFLAGS=								\
11	-DCLUTTER_ENABLE_COMPOSITOR_API					\
12	-DCLUTTER_ENABLE_EXPERIMENTAL_API				\
13	-DCOGL_ENABLE_EXPERIMENTAL_API \
14	-DCOGL_ENABLE_EXPERIMENTAL_2_0_API                              \
15	-DCOGL_ENABLE_MUFFIN_API					\
16	$(WARN_CFLAGS)							\
17	$(MUFFIN_CFLAGS)						\
18	-I$(srcdir)							\
19	-I$(srcdir)/core						\
20	-I$(srcdir)/ui							\
21	-I$(srcdir)/compositor						\
22	-I$(top_srcdir)/cogl						\
23	-I$(top_srcdir)/cogl/cogl					\
24	-I$(top_srcdir)/cogl/cogl/winsys				\
25	-I$(top_builddir)/cogl/cogl					\
26	-I$(top_builddir)/cogl						\
27	-I$(top_srcdir)/clutter						\
28	-I$(top_srcdir)/clutter/clutter					\
29	-I$(top_builddir)/clutter					\
30	-I$(top_builddir)/clutter/clutter				\
31	-DMUFFIN_LIBEXECDIR=\"$(libexecdir)\"				\
32	-DHOST_ALIAS=\"@HOST_ALIAS@\"					\
33	-DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"		\
34	-DMUFFIN_PKGDATADIR=\"$(pkgdatadir)\"				\
35	-DMUFFIN_DATADIR=\"$(datadir)\"					\
36	-DG_LOG_DOMAIN=\"muffin\"					\
37	-DSN_API_NOT_YET_FROZEN=1					\
38	-DMUFFIN_MAJOR_VERSION=$(MUFFIN_MAJOR_VERSION)			\
39	-DMUFFIN_MINOR_VERSION=$(MUFFIN_MINOR_VERSION)			\
40	-DMUFFIN_MICRO_VERSION=$(MUFFIN_MICRO_VERSION)			\
41	-DMUFFIN_PLUGIN_API_VERSION=$(MUFFIN_PLUGIN_API_VERSION)	\
42	-DMUFFIN_PKGLIBDIR=\"$(pkglibdir)\"				\
43	-DMUFFIN_PLUGIN_DIR=\"@MUFFIN_PLUGIN_DIR@\"			\
44	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"
45
46muffin_built_sources = \
47	muffin-enum-types.h \
48	muffin-enum-types.c
49
50libmuffin_la_SOURCES =				\
51	core/async-getprop.c			\
52	core/async-getprop.h			\
53	core/bell.c				\
54	core/bell.h				\
55	core/boxes.c				\
56	core/boxes-private.h			\
57	meta/boxes.h				\
58	compositor/clutter-utils.c \
59	compositor/clutter-utils.h \
60	compositor/cogl-utils.c			\
61	compositor/cogl-utils.h			\
62	compositor/compositor.c			\
63	compositor/compositor-private.h		\
64	compositor/meta-background.c 		\
65	compositor/meta-background.h 		\
66	compositor/meta-background-actor.c	\
67	compositor/meta-background-actor-private.h	\
68	compositor/meta-module.c		\
69	compositor/meta-module.h		\
70	compositor/meta-plugin.c		\
71	compositor/meta-plugin-manager.c	\
72	compositor/meta-plugin-manager.h	\
73	compositor/meta-shadow-factory.c	\
74	compositor/meta-shadow-factory-private.h	\
75	compositor/meta-shaped-texture.c	\
76	compositor/meta-shaped-texture-private.h	\
77	compositor/meta-sync-ring.c \
78	compositor/meta-sync-ring.h \
79	compositor/meta-texture-rectangle.c	\
80	compositor/meta-texture-rectangle.h	\
81	compositor/meta-texture-tower.c		\
82	compositor/meta-texture-tower.h		\
83	compositor/meta-window-actor.c		\
84	compositor/meta-window-actor-private.h	\
85	compositor/meta-window-group.c		\
86	compositor/meta-window-group.h		\
87	compositor/meta-window-shape.c		\
88	compositor/meta-window-shape.h		\
89	compositor/region-utils.c		\
90	compositor/region-utils.h		\
91	meta/compositor.h			\
92	meta/meta-background-actor.h		\
93	meta/meta-plugin.h			\
94	meta/meta-shadow-factory.h		\
95	meta/meta-window-actor.h		\
96	meta/compositor-muffin.h 		\
97	core/above-tab-keycode.c		\
98	core/constraints.c			\
99	core/constraints.h			\
100	core/core.c				\
101	core/delete.c				\
102	core/display.c				\
103	core/display-private.h			\
104	meta/display.h				\
105	ui/draw-workspace.c			\
106	ui/draw-workspace.h			\
107	core/edge-resistance.c			\
108	core/edge-resistance.h			\
109	core/errors.c				\
110	meta/errors.h				\
111	core/eventqueue.c			\
112	core/eventqueue.h			\
113	core/frame.c				\
114	core/frame.h				\
115	ui/gradient.c				\
116	meta/gradient.h				\
117	core/group-private.h			\
118	core/group-props.c			\
119	core/group-props.h			\
120	core/group.c				\
121	meta/group.h				\
122	core/iconcache.c			\
123	core/iconcache.h			\
124	core/keybindings.c			\
125	core/keybindings-private.h		\
126	core/main.c				\
127	core/muffin-Xatomtype.h			\
128	core/place.c				\
129	core/place.h				\
130	core/prefs.c				\
131	meta/prefs.h				\
132	core/screen.c				\
133	core/screen-private.h			\
134	meta/screen.h				\
135	meta/types.h				\
136	core/session.c				\
137	core/session.h				\
138	core/restart.c				\
139	core/stack.c				\
140	core/stack.h				\
141	core/stack-tracker.c			\
142	core/stack-tracker.h			\
143	core/util.c				\
144	meta/util.h				\
145	meta/util-private.h		\
146	core/window-props.c			\
147	core/window-props.h			\
148	core/window.c				\
149	core/window-private.h			\
150	meta/window.h				\
151	core/workspace.c			\
152	core/workspace-private.h		\
153	core/xprops.c				\
154	core/xprops.h				\
155	meta/common.h				\
156	core/core.h				\
157	ui/ui.h					\
158	inlinepixbufs.h				\
159	ui/frames.c				\
160	ui/frames.h				\
161	ui/menu.c				\
162	ui/menu.h				\
163	ui/metaaccellabel.c			\
164	ui/metaaccellabel.h			\
165	ui/resizepopup.c			\
166	ui/resizepopup.h			\
167	ui/theme-parser.c			\
168	ui/theme.c				\
169	meta/theme.h				\
170	ui/theme-private.h			\
171	ui/ui.c					\
172	meta/preview-widget.h			\
173	ui/preview-widget.c			\
174	$(muffin_built_sources) \
175	$(NULL)
176
177libmuffin_la_LDFLAGS = $(WARN_LDFLAGS) -no-undefined -export-symbols-regex "^(meta|ag)_.*"
178libmuffin_la_LIBADD  = \
179  $(MUFFIN_LIBS) \
180	$(top_builddir)/clutter/clutter/libmuffin-clutter-$(MUFFIN_PLUGIN_API_VERSION).la \
181	$(top_builddir)/cogl/cogl/libmuffin-cogl-$(MUFFIN_PLUGIN_API_VERSION).la \
182	$(top_builddir)/cogl/cogl-pango/libmuffin-cogl-pango-$(MUFFIN_PLUGIN_API_VERSION).la \
183	$(top_builddir)/cogl/cogl-path/libmuffin-cogl-path-$(MUFFIN_PLUGIN_API_VERSION).la \
184	-lm \
185	-lglib-2.0 \
186	$(NULL)
187
188# Headers installed for plugins; introspected information will
189# be extracted into Muffin-<version>.gir
190libmuffininclude_base_headers =		\
191	meta/boxes.h				\
192	meta/common.h				\
193	meta/compositor-muffin.h		\
194	meta/compositor.h			\
195	meta/display.h				\
196	meta/errors.h				\
197	meta/gradient.h				\
198	meta/group.h				\
199	meta/keybindings.h			\
200	meta/main.h				\
201	meta/meta-background-actor.h		\
202	meta/meta-plugin.h			\
203	meta/meta-shaped-texture.h		\
204	meta/meta-shadow-factory.h		\
205	meta/meta-window-actor.h		\
206	meta/prefs.h				\
207	meta/screen.h				\
208	meta/theme.h				\
209	meta/types.h				\
210	meta/util.h				\
211	meta/window.h				\
212	meta/workspace.h
213
214# Excluded from scanning for introspection but installed
215# atomnames.h: macros cause problems for scanning process
216libmuffininclude_extra_headers =		\
217	meta/preview-widget.h			\
218	meta/atomnames.h
219
220libmuffinincludedir = $(includedir)/muffin/meta
221
222libmuffininclude_HEADERS =			\
223	$(libmuffininclude_base_headers)	\
224	$(libmuffininclude_extra_headers)
225
226muffin_theme_viewer_SOURCES=  \
227	ui/theme-viewer.c
228
229bin_PROGRAMS=muffin muffin-theme-viewer
230
231muffin_SOURCES = core/muffin.c
232muffin_LDADD = $(MUFFIN_LIBS) libmuffin.la
233
234libexec_PROGRAMS = muffin-restart-helper
235muffin_restart_helper_SOURCES = core/restart-helper.c
236muffin_restart_helper_LDADD = $(MUFFIN_LIBS)
237
238if HAVE_INTROSPECTION
239include $(INTROSPECTION_MAKEFILE)
240
241# Since we don't make any guarantees about stability and we don't support
242# parallel install, there's no real reason to change directories, filenames,
243# etc. as we change the Muffin tarball version.
244#
245# Change the api_version to a muffin specific number since setting it to
246# 3.0 causes major dependency issues with muffin on distributions which
247# auto generate typelib dependencies in RPMS
248api_version = Muffin.0
249#api_version = 3.0
250
251# These files are in package-private directories, even though they may be used
252# by plugins.  If you're writing a plugin, use g-ir-compiler --add-include-path
253# and g-ir-compiler --includedir.
254girdir = $(pkglibdir)
255gir_DATA = Meta-$(api_version).gir
256
257typelibdir = $(pkglibdir)
258typelib_DATA = Meta-$(api_version).typelib
259
260INTROSPECTION_GIRS = Meta-$(api_version).gir
261INTROSPECTION_SCANNER_ARGS =					\
262	--add-include-path=$(top_builddir)/clutter/clutter	\
263	--add-include-path=$(top_builddir)/cogl/cogl		\
264	--add-include-path=$(top_builddir)/cogl/cogl-pango	\
265	--add-include-path=$(top_builddir)/cogl/cogl-path	\
266	$(NULL)
267INTROSPECTION_COMPILER_ARGS =					\
268	--includedir=$(top_builddir)/clutter/clutter		\
269	--includedir=$(top_builddir)/cogl/cogl			\
270	--includedir=$(top_builddir)/cogl/cogl-pango		\
271	--includedir=$(top_builddir)/cogl/cogl-path		\
272	$(NULL)
273INTROSPECTION_SCANNER_ENV = \
274	PKG_CONFIG_PATH=$(top_builddir)/clutter/clutter/:$(top_builddir)/cogl/cogl/:$(top_builddir)/cogl/cogl-pango/:$(top_builddir)/cogl/cogl-path/:$${PKG_CONFIG_PATH}
275
276Meta-$(api_version).gir: libmuffin.la
277@META_GIR@_INCLUDES = GObject-2.0 CDesktopEnums-3.0 Gdk-3.0 Gtk-3.0 Cogl-$(MUFFIN_PLUGIN_API_VERSION) Clutter-$(MUFFIN_PLUGIN_API_VERSION) xlib-2.0 xfixes-4.0
278@META_GIR@_PACKAGES = gtk+-3.0
279@META_GIR@_CFLAGS = $(AM_CPPFLAGS)
280@META_GIR@_LIBS = libmuffin.la
281@META_GIR@_FILES =				\
282	muffin-enum-types.h			\
283	$(libmuffininclude_base_headers)	\
284	$(filter %.c,$(libmuffin_la_SOURCES))
285@META_GIR@_SCANNERFLAGS = $(WARN_SCANNERFLAGS) --warn-all  --identifier-prefix=Meta
286
287endif
288
289muffin_theme_viewer_LDADD= $(MUFFIN_LIBS) libmuffin.la
290
291testboxes_SOURCES = core/testboxes.c core/boxes.c core/util.c
292testgradient_SOURCES = ui/testgradient.c
293testasyncgetprop_SOURCES = core/testasyncgetprop.c core/async-getprop.c
294
295# NO-OP: work around the fact that source code tested by the programs are
296# compiled for library
297testasyncgetprop_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS)
298testboxes_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS)
299
300noinst_PROGRAMS=testboxes testgradient testasyncgetprop
301
302testboxes_LDADD = $(MUFFIN_LIBS) $(top_builddir)/clutter/clutter/libmuffin-clutter-$(MUFFIN_PLUGIN_API_VERSION).la
303testgradient_LDADD = $(MUFFIN_LIBS) libmuffin.la
304testasyncgetprop_LDADD = $(MUFFIN_LIBS)
305
306
307@INTLTOOL_DESKTOP_RULE@
308
309desktopfilesdir=$(datadir)/applications
310desktopfiles_in_files=muffin.desktop.in
311desktopfiles_files=$(desktopfiles_in_files:.desktop.in=.desktop)
312desktopfiles_DATA = $(desktopfiles_files)
313
314gsettings_SCHEMAS = org.cinnamon.muffin.gschema.xml
315@INTLTOOL_XML_NOMERGE_RULE@
316@GSETTINGS_RULES@
317
318IMAGES=stock_maximize.png stock_minimize.png stock_delete.png
319VARIABLES=stock_maximize_data $(srcdir)/stock_maximize.png \
320		  stock_minimize_data $(srcdir)/stock_minimize.png \
321		  stock_delete_data $(srcdir)/stock_delete.png
322
323BUILT_SOURCES = inlinepixbufs.h
324CLEANFILES =					\
325	inlinepixbufs.h				\
326	muffin.desktop				\
327	org.cinnamon.muffin.gschema.xml		\
328	$(xml_DATA)				\
329	$(muffin_built_sources)			\
330	$(typelib_DATA)				\
331	$(gir_DATA)
332
333inlinepixbufs.h: $(IMAGES)
334	$(GDK_PIXBUF_CSOURCE) --raw --build-list $(VARIABLES) >$(srcdir)/inlinepixbufs.h
335
336pkgconfigdir = $(prefix)/libdata/pkgconfig
337
338pkgconfig_DATA = libmuffin.pc muffin-plugins.pc
339
340EXTRA_DIST=$(desktopfiles_files) 	\
341	$(IMAGES) 			\
342	$(desktopfiles_in_files)	\
343	$(xml_in_files)			\
344	org.cinnamon.muffin.gschema.xml.in \
345	libmuffin.pc.in \
346	muffin-plugins.pc.in  \
347	muffin-enum-types.h.in \
348	muffin-enum-types.c.in
349
350BUILT_SOURCES += $(muffin_built_sources)
351MUFFIN_STAMP_FILES = stamp-muffin-enum-types.h
352CLEANFILES += $(MUFFIN_STAMP_FILES)
353
354muffin-enum-types.h: stamp-muffin-enum-types.h Makefile
355	@true
356stamp-muffin-enum-types.h: $(libmuffininclude_base_headers) muffin-enum-types.h.in
357	$(AM_V_GEN) ( cd $(srcdir) && \
358	  $(GLIB_MKENUMS) \
359		--template muffin-enum-types.h.in \
360	  $(libmuffininclude_base_headers) ) >> xgen-teth && \
361	(cmp -s xgen-teth muffin-enum-types.h || cp xgen-teth muffin-enum-types.h) && \
362	rm -f xgen-teth && \
363	echo timestamp > $(@F)
364
365muffin-enum-types.c: stamp-muffin-enum-types.h muffin-enum-types.c.in
366	  $(AM_V_GEN) ( cd $(srcdir) && \
367	  $(GLIB_MKENUMS) \
368		--template muffin-enum-types.c.in \
369	  $(libmuffininclude_base_headers) ) >> xgen-tetc && \
370	cp xgen-tetc muffin-enum-types.c && \
371	rm -f xgen-tetc
372
373compat_libs="clutter cogl cogl-pango cogl-path"
374
375install-exec-local:
376	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
377	for lib in `echo $(compat_libs)`; do \
378	  (cd $(DESTDIR)$(libdir) && \
379	    rm -f libmuffin-$$lib-0.so; \
380	  ) ; \
381	  (cd $(DESTDIR)$(libdir) && \
382	    { ln -s -f muffin/libmuffin-$$lib-0.so libmuffin-$$lib-0.so || \
383	      { rm -f libmuffin-$$lib-0.so && ln -s muffin/libmuffin-$$lib-0.so libmuffin-$$lib-0.so; }; \
384	    } \
385	  ) ; \
386	done