Move core protocol libraries into wayland/ subdirectory
[profile/ivi/wayland.git] / Makefile
index 383188d..d7d1671 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,69 +1,15 @@
-CFLAGS = -Wall -g
+include config.mk
 
-EAGLE_CFLAGS = -I../eagle
-EAGLE_LDLIBS = -L../eagle -leagle
+subdirs = wayland compositor clients spec data
 
-clients = flower pointer background window
-compositors = egl-compositor.so glx-compositor.so
+all : subdirs-all
 
-all : wayland libwayland.so $(compositors) $(clients)
+subdirs-all subdirs-clean subdirs-install:
+       for f in $(subdirs); do $(MAKE) -C $$f $(@:subdirs-%=%); done
 
-wayland_objs =                                 \
-       wayland.o                               \
-       event-loop.o                            \
-       connection.o                            \
-       hash.o                                  \
-       input.o
+install : subdirs-install
 
-wayland : CFLAGS += $(shell pkg-config --cflags libffi)
-wayland : LDLIBS += $(shell pkg-config --libs libffi) -ldl -rdynamic
+clean : subdirs-clean
 
-wayland : $(wayland_objs)
-       gcc -o $@ $(LDLIBS) $(wayland_objs)
-
-libwayland_objs = wayland-client.o connection.o
-
-libwayland.so : $(libwayland_objs)
-
-$(compositors) $(clients) : CFLAGS += $(shell pkg-config --cflags libdrm)
-
-egl_compositor_objs = egl-compositor.o
-egl-compositor.so : CFLAGS += $(EAGLE_CFLAGS)
-egl-compositor.so : LDLIBS += $(EAGLE_LDLIBS) -rdynamic
-
-egl-compositor.so : $(egl_compositor_objs)
-
-glx_compositor_objs = glx-compositor.o
-glx-compositor.so : LDLIBS += -lGL
-
-glx-compositor.so : $(glx_compositor_objs)
-
-
-libwayland.so $(compositors) :
-       gcc -o $@ $^ $(LDLIBS) -shared 
-
-flower_objs = flower.o
-pointer_objs = pointer.o
-background_objs = background.o
-window_objs = window.o gears.o
-
-$(clients) : CFLAGS += $(shell pkg-config --cflags cairo)
-$(clients) : LDLIBS += $(shell pkg-config --libs cairo) -lrt
-
-background : CFLAGS += $(shell pkg-config --cflags gdk-pixbuf-2.0)
-background : LDLIBS += $(shell pkg-config --libs gdk-pixbuf-2.0)
-
-window : CFLAGS += $(EAGLE_CFLAGS)
-window : LDLIBS += $(EAGLE_LDLIBS)
-
-define client_template
-$(1): $$($(1)_objs) libwayland.so
-endef
-
-$(foreach c,$(clients),$(eval $(call client_template,$(c))))
-
-$(clients) :
-       gcc -o $@ -L. -lwayland $(LDLIBS) $^
-
-clean :
-       rm -f $(clients) wayland *.o *.so
+config.mk : config.mk.in
+       ./config.status