summaryrefslogtreecommitdiff
path: root/lib/libgbm/Makefile
blob: b525c08bf54589d44155572ac77c73aefa628d38 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# $OpenBSD: Makefile,v 1.1 2014/07/09 21:32:42 jsg Exp $
.include <bsd.xconf.mk>

LIB=	gbm

MESA=	${.CURDIR}/../../dist/Mesa/src/mesa
GBM=	${.CURDIR}/../../dist/Mesa/src/gbm
LOADER=	${.CURDIR}/../../dist/Mesa/src/loader

MESA_INCLUDE=		${.CURDIR}/../../dist/Mesa/include
DEFAULT_DRIVER_DIR=     ${X11BASE}/lib/modules/dri

MESA_MAJOR=	10
MESA_MINOR=	2
MESA_TINY=	3

INCSDIR=	${X11BASE}/include

INCS= \
	gbm.h

GBM_SOURCES= \
	gbm.c \
	backend.c \
	gbm_dri.c \

LOADER_SOURCES= \
	loader.c \
	pci_id_driver_map.c

CFLAGS+= -std=c99 -fvisibility=hidden

CPPFLAGS+= \
	-I${MESA_INCLUDE} \
	-I${GBM}/main \
	-I${LOADER} \
	-I${X11BASE}/include \
	-I/usr/include/dev/pci/drm \
	-DHAVE_PTHREAD \
	-D_OS_UNIX=1 \
	-DMODULEDIR=\"${X11BASE}/lib/modules/gbm\" \
	-DDEFAULT_DRIVER_DIR=\"${DEFAULT_DRIVER_DIR}\"

SRCS= \
	${GBM_SOURCES} \
	${LOADER_SOURCES}

LDADD=	-L${X11BASE}/lib -lpthread -ldrm

includes: _SUBDIRUSE
	cd ${GBM}/main; for i in ${INCS}; do \
	    j="cmp -s $$i ${DESTDIR}${INCSDIR}/$$i || \
		${INSTALL_DATA}	$$i ${DESTDIR}${INCSDIR}"; \
		echo "\tinstalling $$i"; \
		eval "$$j"; \
	done

NOPROFILE=

obj: _xenocara_obj

.include <bsd.lib.mk>
.include <bsd.xorg.mk>

gbm.pc: ${GBM}/main/gbm.pc.in Makefile
	sed -e 's,@prefix@,$(X11BASE),' \
	    -e 's,@exec_prefix@,${X11BASE},' \
	    -e 's,@libdir@,${LIBDIR},' \
	    -e 's,@includedir@,${INCSDIR},' \
	    -e 's,@GBM_PC_REQ_PRIV@,,' \
	    -e 's,@GBM_PC_LIB_PRIV@,-m -lpthread,' \
	    -e 's,@GBM_PC_CFLAGS@,,' \
	    -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
	< ${GBM}/main/gbm.pc.in > gbm.pc

afterinstall: gbm.pc
	$(INSTALL) -c -m 644 -o root -g wheel gbm.pc \
		${DESTDIR}${LIBDIR}/pkgconfig

CLEANFILES+= gbm.pc

.PATH: ${GBM}
.PATH: ${GBM}/main
.PATH: ${GBM}/backends/dri
.PATH: ${LOADER}