1 CFLAGS = -Wall -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden
3 PKG_CONFIG_PATH ?= $(HOME)/install/lib/pkgconfig
5 EAGLE_CFLAGS = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags eagle)
6 EAGLE_LDLIBS = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs eagle)
8 clients = flower pointer background window
9 compositors = egl-compositor.so glx-compositor.so
11 all : wayland libwayland.so $(compositors) $(clients)
20 wayland : CFLAGS += $(shell pkg-config --cflags libffi)
21 wayland : LDLIBS += $(shell pkg-config --libs libffi) -ldl -rdynamic
23 wayland : $(wayland_objs)
24 gcc -o $@ $(LDLIBS) $(wayland_objs)
26 libwayland_objs = wayland-client.o connection.o
28 libwayland.so : $(libwayland_objs)
30 $(compositors) $(clients) : CFLAGS += $(shell pkg-config --cflags libdrm)
32 egl_compositor_objs = egl-compositor.o
33 egl-compositor.so : CFLAGS += $(EAGLE_CFLAGS)
34 egl-compositor.so : LDLIBS += $(EAGLE_LDLIBS) -rdynamic
36 egl-compositor.so : $(egl_compositor_objs)
38 glx_compositor_objs = glx-compositor.o
39 glx-compositor.so : LDLIBS += -lGL
41 glx-compositor.so : $(glx_compositor_objs)
44 libwayland.so $(compositors) :
45 gcc -o $@ $^ $(LDLIBS) -shared
47 flower_objs = flower.o wayland-glib.o
48 pointer_objs = pointer.o wayland-glib.o cairo-util.o
49 background_objs = background.o wayland-glib.o
50 window_objs = window.o gears.o wayland-glib.o cairo-util.o
52 $(clients) : CFLAGS += $(shell pkg-config --cflags cairo glib-2.0)
53 $(clients) : LDLIBS += $(shell pkg-config --libs cairo glib-2.0) -lrt
55 background : CFLAGS += $(shell pkg-config --cflags gdk-pixbuf-2.0)
56 background : LDLIBS += $(shell pkg-config --libs gdk-pixbuf-2.0)
58 window : CFLAGS += $(EAGLE_CFLAGS)
59 window : LDLIBS += $(EAGLE_LDLIBS)
61 define client_template
62 $(1): $$($(1)_objs) libwayland.so
65 $(foreach c,$(clients),$(eval $(call client_template,$(c))))
68 gcc -o $@ -L. -lwayland $(LDLIBS) $^
71 rm -f $(clients) wayland *.o *.so