-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
60 lines (51 loc) · 985 Bytes
/
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
include ../flags.makefile
# find ${PROTODIR} -iname '*.xml' -exec basename {} .xml \;
# without ge, xf86vidmode
PROTOS= \
present \
dpms \
shm \
damage \
dri3 \
render \
xfixes \
screensaver \
bigreq \
xprint \
xinerama \
xkb \
xc_misc \
record \
xproto \
xvmc \
dri2 \
xinput \
sync \
randr \
xtest \
res \
shape \
xevie \
glx \
xv \
xselinux \
xf86dri \
composite
PYTHON=python2
CLIENT=cpp_client.py
XCBGEN=/usr/lib/python3.3/site-packages
PROTODIR=/usr/share/xcb
XMLPROTOS=$(PROTOS:%=%.xml)
HPPPROTOS=$(XMLPROTOS:%.xml=%.hpp)
all: ${XMLPROTOS}
gch: ${HPPPROTOS}
${HPPPROTOS}:
-${CXX} ${CXXFLAGS} ${LDFLAGS} -c $(if $(filter $@,xproto.hpp),x.hpp,$(@))
${XMLPROTOS}:
-${PYTHON} ${CLIENT} -p ${XCBGEN} ${PROTODIR}/$@ > $(if $(filter $@,xproto.xml),x.hpp,$(@:%.xml=%.hpp))
find:
@ find ${PROTODIR} -iname '*.xml' -exec basename {} .xml \;
clean:
rm -f ${PROTOS:%=%.hpp}
rm -f $(PROTOS:%=%.hpp.gch)
.PHONY: clean find ${XMLPROTOS} ${HPPPROTOS}