-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
49 lines (35 loc) · 2 KB
/
Makefile
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
WAYLAND_SCANNER = $(SYSROOT_DIR)/$(shell pkg-config --variable=wayland_scanner wayland-scanner)
WAYLAND_PROTOCOLS_DIR = $(SYSROOT_DIR)/$(shell pkg-config wayland-protocols --variable=pkgdatadir)
XDG_SHELL_PROTOCOL = $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml
POINTER_CONSTRAINTS_PROTOCOL = $(WAYLAND_PROTOCOLS_DIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
RELATIVE_POINTER_PROTOCOL = $(WAYLAND_PROTOCOLS_DIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml
WL_HEADERS = xdg-shell-client-protocol.h pointer-constraints-unstable-v1-client-protocol.h relative-pointer-unstable-v1-client-protocol.h
WL_CODE = xdg-shell-protocol.c pointer-constraints-protocol.c relative-pointer-protocol.c
LIBS=-lwayland-client -lffi -lxkbcommon -lpthread
LIBS_STATIC=./build/libwayland-client.a ./build/libffi.a ./build/libxkbcommon.a -lpthread
xdg-shell-client-protocol.h:
$(WAYLAND_SCANNER) client-header $(XDG_SHELL_PROTOCOL) xdg-shell-client-protocol.h
xdg-shell-protocol.c:
$(WAYLAND_SCANNER) private-code $(XDG_SHELL_PROTOCOL) xdg-shell-protocol.c
pointer-constraints-unstable-v1-client-protocol.h:
$(WAYLAND_SCANNER) client-header $(POINTER_CONSTRAINTS_PROTOCOL) pointer-constraints-unstable-v1-client-protocol.h
pointer-constraints-protocol.c:
$(WAYLAND_SCANNER) private-code $(POINTER_CONSTRAINTS_PROTOCOL) pointer-constraints-protocol.c
relative-pointer-unstable-v1-client-protocol.h:
$(WAYLAND_SCANNER) client-header $(RELATIVE_POINTER_PROTOCOL) relative-pointer-unstable-v1-client-protocol.h
relative-pointer-protocol.c:
$(WAYLAND_SCANNER) private-code $(RELATIVE_POINTER_PROTOCOL) relative-pointer-protocol.c
all: client.c $(WL_HEADERS) $(WL_CODE)
$(CC) $(CFLAGS) \
-g -std=c11 \
-o client client.c $(WL_HEADERS) $(WL_CODE) \
$(LIBS)
static: client.c $(WL_HEADERS) $(WL_CODE) $(LIBS_STATIC)
$(CC) $(CFLAGS) \
-g -std=c11 \
-o client client.c $(WL_HEADERS) $(WL_CODE) \
$(LIBS_STATIC) -static
.DEFAULT_GOAL=all
.PHONY: clean
clean:
$(RM) client $(WL_HEADERS) $(WL_CODE)