summaryrefslogtreecommitdiff
path: root/pkg/wld/gen.rc
blob: e166a21a45e3fc902f41761a184e7312afd394f4 (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
cflags=(\
	-D WITH_WAYLAND_SHM\
	-D WITH_WAYLAND_DRM\
	-I '$outdir' \
	-I pkg/fontconfig/src\
	-I pkg/freetype/src/include\
	-I pkg/libdrm/src\
	-I pkg/libdrm/src/include/drm\
	-I '$builddir'/pkg/pixman/include\
	-I '$builddir'/pkg/wayland/include\
)

hdrs=(drm.h pixman.h wayland.h wld.h)
for(hdr in $hdrs) {
	build '$outdir'/include/wld/$hdr copy '$srcdir'/$hdr
	file include/wld/$hdr '$srcdir'/$hdr 644
}
phony headers '$outdir'/include/wld/$hdrs

srcs=(\
	buffer.c\
	buffered_surface.c\
	color.c\
	context.c\
	drm.c\
	dumb.c\
	font.c\
	renderer.c\
	surface.c\
	pixman.c\
	wayland.c\
	wayland-shm.c\
	wayland-drm.c\
	wayland-drm-protocol.c.o\
)
libs=(\
	fontconfig/libfontconfig.a.d\
	freetype/libfreetype.a.d\
	libdrm/libdrm.a\
	pixman/libpixman.a\
	wayland/libwayland-client.a.d\
)

if(~ intel $config_video_drivers) {
	cflags=($cflags -D WITH_DRM_INTEL -I pkg/libdrm/src/intel)
	srcs=($srcs intel.c intel/batch.c)
	libs=($libs libdrm/libdrm_intel.a.d)
}
if(~ nouveau $config_video_drivers) {
	cflags=($cflags -D WITH_DRM_NOUVEAU -I pkg/libdrm/src/nouveau)
	srcs=($srcs nouveau.c)
	libs=($libs libdrm/libdrm_nouveau.a)
}

cflags $cflags

waylandproto protocol/wayland-drm.xml\
	protocol/wayland-drm-^(client server)^-protocol.h\
	wayland-drm-protocol.c

phony deps\
	'$outdir'/protocol/wayland-drm-client-protocol.h\
	'$builddir'/pkg/^(fontconfig freetype libdrm)^/fetch.stamp\
	pkg/^(pixman wayland)^/headers

lib libwld.a -d '$dir'/deps $srcs '$builddir'/pkg/$libs

fetch git