Move core protocol libraries into wayland/ subdirectory
[profile/ivi/wayland.git] / Makefile
index 44a0b04..d7d1671 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,15 @@
-CFLAGS +=  -Wall -g $(shell pkg-config --cflags libffi libdrm)
-LDLIBS += $(shell pkg-config --libs libffi libdrm)
+include config.mk
 
-all : wayland client
+subdirs = wayland compositor clients spec data
 
-wayland_objs = wayland.o event-loop.o hash.o compositor.o
+all : subdirs-all
 
-wayland : $(wayland_objs)
-       gcc -o $@ $(wayland_objs) $(LDLIBS)
+subdirs-all subdirs-clean subdirs-install:
+       for f in $(subdirs); do $(MAKE) -C $$f $(@:subdirs-%=%); done
 
-libwayland_objs = wayland-client.o
+install : subdirs-install
 
-libwayland.so : $(libwayland_objs)
-       gcc -o $@ $(libwayland_objs) -shared
+clean : subdirs-clean
 
-client_objs = client.o
-client : CFLAGS += $(shell pkg-config --cflags cairo)
-client : LDLIBS += $(shell pkg-config --libs cairo)
-
-client : $(client_objs) libwayland.so
-       gcc -o $@ -L. -lwayland $(LDLIBS) $(client_objs)
-
-clean :
-       rm -f client wayland *.o libwayland.so
\ No newline at end of file
+config.mk : config.mk.in
+       ./config.status