Home | History | Annotate | Line # | Download | only in llvm
Makefile revision 1.14
      1 #	$NetBSD: Makefile,v 1.14 2012/06/16 17:01:04 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 CC=${HOST_CC:Q} --prefix=/usr \
     23 	    --enable-targets=x86,powerpc,sparc,arm,mips \
     24 	    --host=${MACHINE_GNU_PLATFORM} \
     25 	    --with-c-include-dirs=/usr/include/clang-3.2:/usr/include \
     26 	    --with-clang-srcdir=${CLANG_SRCDIR} \
     27 	    --enable-optimized llvm_cv_gnu_make_command=${MAKE}
     28 # --disable-assertions
     29 
     30 need-dl:
     31 	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
     32 	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
     33 		echo > ${.TARGET}; \
     34 	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
     35 		echo -ldl > ${.TARGET}; \
     36 	else \
     37 		echo > ${.TARGET}; \
     38 	fi
     39 
     40 CLEANFILES+=	need-dl need-dl.c need-dl.out
     41 
     42 cleandir: cleandir-llvm
     43 
     44 cleandir-llvm:
     45 	test ! -d config || rm -r config
     46 	rm -f need-dl need-dl.tmp
     47 
     48 .include <bsd.hostprog.mk>
     49