2013-09-05 09:11:54 -06:00
|
|
|
# $OpenBSD: Makefile.inc,v 1.4 2013/09/05 15:11:59 jsg Exp $
|
2013-04-14 04:23:04 -06:00
|
|
|
.include <bsd.xconf.mk>
|
2012-07-13 06:43:30 -06:00
|
|
|
|
|
|
|
CPP= cpp -notraditional
|
|
|
|
|
2013-09-05 09:11:54 -06:00
|
|
|
CFLAGS+= -std=c99
|
|
|
|
CPPFLAGS+= -DPACKAGE_BUGREPORT=\"bugs@openbsd.org\"
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
# Remember to keep in sync with LLVM port's version.
|
2013-09-05 09:11:54 -06:00
|
|
|
LLVM_VERSION= 0x303 # 3.3
|
2012-07-13 06:43:30 -06:00
|
|
|
LLVM_CONFIG?= /usr/local/bin/llvm-config
|
|
|
|
|
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 \
|
|
|
|
-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
|
|
|
|
2013-09-05 09:11:54 -06:00
|
|
|
# for r600 and radeonsi
|
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
LDADD+= ${LOCALBASE}/lib/libelf.a
|
|
|
|
.endif
|
2012-07-13 06:43:30 -06:00
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == sparc
|
|
|
|
PICFLAG=-fPIC
|
|
|
|
.endif
|