1 # $NetBSD: Makefile,v 1.1 2011/02/06 01:14:11 joerg Exp $ 2 3 .include <bsd.init.mk> 4 5 # 6 # Do *not* set HOSTPROG or HOSTLIB at this point otherwise 7 # it will create a loop trying to extract the object directory. 8 # 9 .include "Makefile.inc" 10 .include "${LLVM_TOPLEVEL}/lib/Makefile.inc" 11 12 realdepends realall: config/config.status need-dl \ 13 config/include/clang/Basic/Version.inc 14 15 config/include/clang/Basic/Version.inc: \ 16 ${LLVM_TOPLEVEL}/config/clang/Basic/Version.inc 17 mkdir -p ${.TARGET:H} 18 cat < ${.ALLSRC} > ${.TARGET} 19 20 config/config.status: ${LLVM_SRCDIR}/configure 21 mkdir -p config 22 cd config && ${LLVM_SRCDIR}/configure --prefix=/usr \ 23 --enable-targets=x86 --host=x86_64--netbsd --with-clang-resource-dir=${DESTDIR}/usr/lib 24 25 need-dl: 26 printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c 27 if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \ 28 echo > ${.TARGET}; \ 29 elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \ 30 echo -ldl > ${.TARGET}; \ 31 else \ 32 echo > ${.TARGET}; \ 33 fi 34 35 CLEANFILES+= need-dl need-dl.c need-dl.out 36 37 cleandir: cleandir-llvm 38 39 cleandir-llvm: 40 rm -r config 41 rm -f need-dl need-dl.tmp 42 43 .include <bsd.hostprog.mk> 44