2013-04-14 04:23:04 -06:00
|
|
|
# $OpenBSD: Makefile.inc,v 1.3 2013/04/14 10:23:04 mpi Exp $
|
|
|
|
.include <bsd.xconf.mk>
|
2012-07-13 06:43:30 -06:00
|
|
|
|
|
|
|
CPP= cpp -notraditional
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
# Remember to keep in sync with LLVM port's version.
|
2012-07-13 06:43:30 -06:00
|
|
|
LLVM_VERSION= 0x301 # 3.1
|
|
|
|
LLVM_CONFIG?= /usr/local/bin/llvm-config
|
|
|
|
|
|
|
|
LLVM_CFLAGS!= ${LLVM_CONFIG} --cflags
|
|
|
|
LLVM_CPPFLAGS!= ${LLVM_CONFIG} --cxxflags
|
2012-11-11 05:09:09 -07:00
|
|
|
LLVM_LIBDIR!= ${LLVM_CONFIG} --libdir
|
2012-07-13 06:43:30 -06:00
|
|
|
LLVM_LIBS!= ${LLVM_CONFIG} --libs engine
|
|
|
|
|
|
|
|
CFLAGS+= ${LLVM_CFLAGS} -std=gnu99
|
|
|
|
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 \
|
|
|
|
-DHAVE_LLVM=${LLVM_VERSION}
|
2013-04-14 04:23:04 -06:00
|
|
|
|
|
|
|
SWRAST_DRIVERS+= ../../gallium/drivers/llvmpipe/libllvmpipe_pic.a
|
2012-07-13 06:43:30 -06:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == sparc
|
|
|
|
PICFLAG=-fPIC
|
|
|
|
.endif
|