2012-07-13 06:55:32 -06:00
|
|
|
# $OpenBSD: Makefile.inc,v 1.13 2012/07/13 12:55:32 mpi Exp $
|
2008-03-25 17:41:50 -06:00
|
|
|
.include <bsd.xconf.mk>
|
2007-12-04 15:00:27 -07:00
|
|
|
|
|
|
|
MESA= ${.CURDIR}/../../../../dist/Mesa/src/mesa
|
|
|
|
TOP= ${.CURDIR}/../../../../dist/Mesa
|
|
|
|
|
|
|
|
DRI_DRIVER_INSTALL_DIR= ${X11BASE}/lib/modules/dri
|
|
|
|
|
2010-05-22 14:14:14 -06:00
|
|
|
COMMON_GALLIUM_SOURCES = \
|
2007-12-04 15:00:27 -07:00
|
|
|
utils.c \
|
|
|
|
vblank.c \
|
|
|
|
dri_util.c \
|
|
|
|
xmlconfig.c \
|
|
|
|
|
2010-05-22 14:14:14 -06:00
|
|
|
COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
|
|
|
|
driverfuncs.c \
|
|
|
|
texmem.c \
|
|
|
|
drirenderbuffer.c \
|
|
|
|
dri_metaops.c
|
|
|
|
|
|
|
|
CFLAGS+= -g -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DPTHREADS \
|
|
|
|
$(INCLUDES) $(DRIVER_DEFINES)
|
|
|
|
|
|
|
|
.if (${COMPILER_VERSION:L:Mgcc[34]*} != "")
|
|
|
|
CFLAGS += -std=c99
|
|
|
|
.endif
|
|
|
|
|
2007-12-04 15:00:27 -07:00
|
|
|
INCLUDES = \
|
|
|
|
-I$(TOP)/src/mesa/drivers/dri/common \
|
|
|
|
-I$(TOP)/include \
|
|
|
|
-I$(TOP)/include/GL/internal \
|
|
|
|
-I$(TOP)/src/mesa \
|
|
|
|
-I$(TOP)/src/mesa/main \
|
2011-10-23 07:57:36 -06:00
|
|
|
-I$(TOP)/src/mapi \
|
2007-12-04 15:00:27 -07:00
|
|
|
-I$(TOP)/src/mesa/math \
|
|
|
|
-I$(TOP)/src/mesa/transform \
|
|
|
|
-I$(TOP)/src/mesa/shader \
|
|
|
|
-I$(TOP)/src/mesa/swrast \
|
|
|
|
-I$(TOP)/src/mesa/swrast_setup \
|
|
|
|
-I$(TOP)/src/egl/main \
|
|
|
|
-I$(TOP)/src/egl/drivers/dri \
|
|
|
|
-I$(X11BASE)/include \
|
2009-01-10 09:06:51 -07:00
|
|
|
-I/usr/include/dev/pci/drm
|
2007-12-04 15:00:27 -07:00
|
|
|
|
2008-11-02 08:01:32 -07:00
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
CPPFLAGS += \
|
|
|
|
-DUSE_X86_ASM \
|
|
|
|
-DUSE_MMX_ASM \
|
|
|
|
-DUSE_3DNOW_ASM \
|
|
|
|
-DUSE_SSE_ASM
|
|
|
|
.elif ${MACHINE_ARCH} == "amd64"
|
|
|
|
CPPFLAGS += -DUSE_X86_64_ASM
|
|
|
|
.endif
|
|
|
|
|
2012-07-13 06:55:32 -06:00
|
|
|
LDADD?= ../../libmesa/libmesa_pic.a \
|
2011-10-23 07:57:36 -06:00
|
|
|
../../glsl/libglsl/libglsl_pic.a \
|
|
|
|
-L${X11BASE}/lib -lexpat -ldrm -lm -lstdc++ -lc
|
2012-07-13 06:55:32 -06:00
|
|
|
DPADD?= ../../libmesa/libmesa_pic.a
|
2008-04-19 01:15:17 -06:00
|
|
|
|
2007-12-04 15:00:27 -07:00
|
|
|
.PATH: ${MESA}/drivers/dri/common
|
|
|
|
.PATH: ${MESA}/drivers/common
|
|
|
|
|
|
|
|
.SUFFIXES:
|
2011-10-23 07:57:36 -06:00
|
|
|
.SUFFIXES: .a .c .cpp .o .S .s .so
|
2007-12-04 15:00:27 -07:00
|
|
|
|
|
|
|
.c.so:
|
|
|
|
@echo "${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
|
|
|
|
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2011-10-23 07:57:36 -06:00
|
|
|
.cpp.so:
|
|
|
|
@echo "${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
|
|
|
|
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
|
|
|
|
2007-12-04 15:00:27 -07:00
|
|
|
all: ${LIB}
|
|
|
|
|
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.so/g}
|
|
|
|
|
|
|
|
${LIB}: ${OBJS} $(DPADD)
|
|
|
|
${CC} -shared ${PICFLAG} -o $@ `${LORDER} ${OBJS}|tsort -q` ${LDADD}
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f ${LIB} ${OBJS}
|
|
|
|
|
|
|
|
cleandir: clean
|
|
|
|
|
|
|
|
install: $(LIB)
|
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
|
|
${LIB} ${DESTDIR}${DRI_DRIVER_INSTALL_DIR}
|
|
|
|
|
|
|
|
.include <bsd.dep.mk>
|