~emersion/vaapi-decoder

ref: wayland vaapi-decoder/Makefile -rw-r--r-- 1.2 KiB
67ad63acSimon Ser Open a Wayland window 8 months ago
                                                                                
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
CFLAGS = -g -Wall -Wextra -Wno-unused-parameter
WAYLAND_PROTOCOLS_DIR = $(shell pkg-config wayland-protocols --variable=pkgdatadir)
WAYLAND_SCANNER = $(shell pkg-config --variable=wayland_scanner wayland-scanner)

deps = libavcodec libavformat libavutil libdrm wayland-client
depflags = $(shell pkg-config $(deps) --cflags --libs)

xdg_shell_protocol = $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml
linux_dmabuf_unstable_v1_protocol = $(WAYLAND_PROTOCOLS_DIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
protocol_files = xdg-shell-client-protocol.h xdg-shell-protocol.c \
	linux-dmabuf-unstable-v1-client-protocol.h linux-dmabuf-unstable-v1-protocol.c

all: vaapi-decoder

vaapi-decoder: main.c $(protocol_files)
	$(CC) $(CFLAGS) $(depflags) -o $@ $^

xdg-shell-client-protocol.h: $(xdg_shell_protocol)
	$(WAYLAND_SCANNER) client-header $< $@
xdg-shell-protocol.c: $(xdg_shell_protocol)
	$(WAYLAND_SCANNER) private-code $< $@
linux-dmabuf-unstable-v1-client-protocol.h: $(linux_dmabuf_unstable_v1_protocol)
	$(WAYLAND_SCANNER) client-header $< $@
linux-dmabuf-unstable-v1-protocol.c: $(linux_dmabuf_unstable_v1_protocol)
	$(WAYLAND_SCANNER) private-code $< $@

clean:
	$(RM) vaapi-decoder $(protocol_files)