summaryrefslogtreecommitdiff
path: root/Makefile
blob: 3de68cb7da03ee15c778620f16cc924c347049f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
include config.mk

subdirs = clients spec
libs = libwayland-server.so libwayland.so

all : $(libs) compositor subdirs-all scanner

headers =					\
	wayland-util.h				\
	wayland-server-protocol.h		\
	wayland.h				\
	wayland-client-protocol.h		\
	wayland-client.h \

libwayland-server.so :				\
	wayland-protocol.o			\
	wayland.o				\
	event-loop.o				\
	connection.o				\
	wayland-util.o				\
	wayland-hash.o

libwayland.so :					\
	wayland-protocol.o			\
	wayland-client.o			\
	connection.o				\
	wayland-util.o				\
	wayland-hash.o

wayland.o : wayland-server-protocol.h
wayland-client.o : wayland-client-protocol.h

wayland-protocol.c : protocol.xml scanner
	./scanner code < $< > $@

wayland-server-protocol.h : protocol.xml scanner
	./scanner server-header < $< > $@

wayland-client-protocol.h : protocol.xml scanner
	./scanner client-header < $< > $@

$(libs) : CFLAGS += -fPIC $(FFI_CFLAGS)
$(libs) : LDLIBS += $(FFI_LIBS)
$(libs) :
	gcc -shared $^ $(LDLIBS)  -o $@

compositor :					\
	compositor.o				\
	compositor-drm.o			\
	compositor-x11.o			\
	screenshooter.o				\
	cairo-util.o				\
	drm.o

compositor : CFLAGS += $(COMPOSITOR_CFLAGS)
compositor : LDLIBS += ./libwayland-server.so $(COMPOSITOR_LIBS) -rdynamic -lrt -lEGL -lm

scanner :					\
	scanner.o				\
	wayland-util.o

scanner : LDLIBS += $(EXPAT_LIBS)

subdirs-all subdirs-clean :
	for f in $(subdirs); do $(MAKE) -C $$f $(@:subdirs-%=%); done

install : $(libs) compositor
	install -d $(libdir) $(libdir)/pkgconfig ${udev_rules_dir}
	install $(libs) $(libdir)
	install wayland-server.pc wayland.pc $(libdir)/pkgconfig
	install $(headers) $(includedir)
	install 70-wayland.rules ${udev_rules_dir}

clean : subdirs-clean
	rm -f compositor scanner *.o *.so
	rm -f wayland-protocol.c \
		wayland-server-protocol.h wayland-client-protocol.h

config.mk : config.mk.in
	./config.status