2014-09-07 09:32:18 -06:00
|
|
|
# $OpenBSD: Makefile.inc,v 1.8 2014/09/07 15:32:18 jsg Exp $
|
2013-04-14 04:23:04 -06:00
|
|
|
.include <bsd.xconf.mk>
|
2014-07-09 15:32:40 -06:00
|
|
|
.include "../config.mk"
|
2013-09-05 09:11:54 -06:00
|
|
|
|
2012-07-13 06:43:30 -06:00
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.so/g}
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .a .c .cpp .o .so
|
|
|
|
|
|
|
|
.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
|
|
|
|
|
|
|
|
.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
|
|
|
|
|
|
|
|
lib${LIB}_pic.a: ${OBJS} ${DPADD}
|
|
|
|
@rm -f lib${LIB}_pic.a
|
|
|
|
@${AR} cq lib${LIB}_pic.a `${LORDER} ${OBJS} | tsort -q`
|
|
|
|
${RANLIB} lib${LIB}_pic.a
|
|
|
|
|
|
|
|
|
2013-04-14 04:23:04 -06:00
|
|
|
.if ${XENOCARA_BUILD_GALLIUM} == "llvm"
|
|
|
|
|
2012-07-13 06:43:30 -06:00
|
|
|
LLVM_CONFIG?= /usr/local/bin/llvm-config
|
2014-09-07 09:32:18 -06:00
|
|
|
LLVM_V!= ${LLVM_CONFIG} --version | sed 's/svn.*//g'
|
|
|
|
LLVM_V_MAJOR!= echo ${LLVM_V} | cut -d. -f 1
|
|
|
|
LLVM_V_MINOR!= echo ${LLVM_V} | cut -d. -f 2
|
|
|
|
LLVM_V_PATCH!= echo ${LLVM_V} | cut -d. -f 3
|
|
|
|
|
|
|
|
.if empty(LLVM_V_PATCH)
|
|
|
|
LLVM_V_PATCH=0
|
|
|
|
.endif
|
|
|
|
|
|
|
|
LLVM_VERSION_INT="${LLVM_V_MAJOR}0${LLVM_V_MINOR}"
|
2012-07-13 06:43:30 -06:00
|
|
|
|
2013-09-05 09:11:54 -06:00
|
|
|
# ugh...
|
|
|
|
ALLVM_CFLAGS!= ${LLVM_CONFIG} --cflags
|
|
|
|
ALLVM_CPPFLAGS!= ${LLVM_CONFIG} --cxxflags
|
|
|
|
BLLVM_CFLAGS= ${ALLVM_CFLAGS:M-[IDf]*}
|
|
|
|
BLLVM_CPPFLAGS= ${ALLVM_CPPFLAGS:M-[IDf]*}
|
|
|
|
LLVM_CFLAGS= ${BLLVM_CFLAGS:S/-DNDEBUG//}
|
|
|
|
LLVM_CPPFLAGS= ${BLLVM_CPPFLAGS:S/-DNDEBUG//}
|
2012-11-11 05:09:09 -07:00
|
|
|
LLVM_LIBDIR!= ${LLVM_CONFIG} --libdir
|
2013-09-05 09:11:54 -06:00
|
|
|
LLVM_LIBS!= ${LLVM_CONFIG} --libs engine bitwriter mcjit r600 bitreader ipo asmparser
|
2012-07-13 06:43:30 -06:00
|
|
|
|
2013-09-05 09:11:54 -06:00
|
|
|
CFLAGS+= ${LLVM_CFLAGS}
|
2012-07-13 06:43:30 -06:00
|
|
|
CXXFLAGS= ${LLVM_CPPFLAGS}
|
2012-11-11 05:09:09 -07:00
|
|
|
LDADD+= -L${LLVM_LIBDIR} ${LLVM_LIBS}
|
2012-07-13 06:43:30 -06:00
|
|
|
|
|
|
|
CPPFLAGS+= \
|
|
|
|
-DGALLIUM_LLVMPIPE \
|
2014-09-07 09:32:18 -06:00
|
|
|
-DHAVE_LLVM=0x0${LLVM_VERSION_INT} -DLLVM_VERSION_PATCH=${LLVM_V_PATCH}
|
2013-04-14 04:23:04 -06:00
|
|
|
|
|
|
|
SWRAST_DRIVERS+= ../../gallium/drivers/llvmpipe/libllvmpipe_pic.a
|
2012-07-13 06:43:30 -06:00
|
|
|
|
2013-09-05 09:11:54 -06:00
|
|
|
# for r600 and radeonsi
|
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
LDADD+= ${LOCALBASE}/lib/libelf.a
|
|
|
|
.endif
|