-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
63 lines (49 loc) · 1.06 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
bin:=$(notdir $(shell pwd))
src:=$(wildcard *.c)
obj:=$(src:.c=.o)
obj+=\
pui/font.o \
pui/font_cp00.o \
pui/font_cp04.o \
toolbox/buffer.o \
toolbox/perf.o
libs:=\
libpipewire-0.3 \
libva \
libva-drm \
wayland-client
protocols_dir:=\
/usr/share/wayland-protocols
protocols:=\
linux-dmabuf-v1 \
pointer-constraints-unstable-v1 \
relative-pointer-unstable-v1 \
viewporter \
xdg-shell
ifdef USE_LIBMFX
libs+=mfx
CFLAGS+=-DUSE_LIBMFX
else
obj+=\
mfx_stub/bitstream.o \
mfx_stub/mfxsession.o \
mfx_stub/mfxvideo.o
CFLAGS+=-Imfx_stub/include
endif
obj:=$(patsubst %,%.o,$(protocols)) $(obj)
headers:=$(patsubst %,%.h,$(protocols))
CFLAGS+=$(shell pkg-config --cflags $(libs))
LDFLAGS+=$(shell pkg-config --libs $(libs))
all: $(bin)
$(bin): $(obj)
$(CC) $^ $(LDFLAGS) -o $@
%.o: %.c *.h */*.h $(headers)
$(CC) -c $< $(CFLAGS) -o $@
%.h: $(protocols_dir)/*/*/%.xml
wayland-scanner client-header $< $@
%.c: $(protocols_dir)/*/*/%.xml
wayland-scanner private-code $< $@
clean:
-rm $(bin) $(obj) $(headers)
.PHONY: all clean
.PRECIOUS: $(headers)