Home | History | Annotate | Line # | Download | only in llvm
Makefile revision 1.11
      1  1.11  joerg #	$NetBSD: Makefile,v 1.11 2011/07/18 19:11:28 joerg Exp $
      2   1.1  joerg 
      3   1.1  joerg .include <bsd.init.mk>
      4   1.1  joerg 
      5   1.1  joerg #
      6   1.1  joerg # Do *not* set HOSTPROG or HOSTLIB at this point otherwise
      7   1.1  joerg # it will create a loop trying to extract the object directory.
      8   1.1  joerg #
      9   1.1  joerg .include "Makefile.inc"
     10   1.1  joerg .include "${LLVM_TOPLEVEL}/lib/Makefile.inc"
     11   1.1  joerg 
     12   1.1  joerg realdepends realall: config/config.status need-dl \
     13   1.1  joerg 	config/include/clang/Basic/Version.inc
     14   1.1  joerg 
     15   1.1  joerg config/include/clang/Basic/Version.inc: \
     16   1.1  joerg 	${LLVM_TOPLEVEL}/config/clang/Basic/Version.inc
     17   1.1  joerg 	mkdir -p ${.TARGET:H}
     18   1.1  joerg 	cat < ${.ALLSRC} > ${.TARGET}
     19   1.1  joerg 
     20   1.1  joerg config/config.status: ${LLVM_SRCDIR}/configure
     21   1.1  joerg 	mkdir -p config
     22  1.10   adam 	cd config && ${LLVM_SRCDIR}/configure CC=${HOST_CC:Q} --prefix=/usr \
     23  1.10   adam 	    --enable-targets=x86,powerpc,sparc,arm,mips \
     24  1.10   adam 	    --host=${MACHINE_GNU_PLATFORM} \
     25   1.4  joerg 	    --with-c-include-dirs=/usr/include/clang-3.0:/usr/include \
     26  1.11  joerg 	    --enable-optimized
     27  1.11  joerg # --disable-assertions
     28   1.4  joerg 
     29   1.1  joerg need-dl:
     30   1.1  joerg 	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
     31   1.1  joerg 	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
     32   1.1  joerg 		echo > ${.TARGET}; \
     33   1.1  joerg 	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
     34   1.1  joerg 		echo -ldl > ${.TARGET}; \
     35   1.1  joerg 	else \
     36   1.1  joerg 		echo > ${.TARGET}; \
     37   1.1  joerg 	fi
     38   1.1  joerg 
     39   1.1  joerg CLEANFILES+=	need-dl need-dl.c need-dl.out
     40   1.1  joerg 
     41   1.1  joerg cleandir: cleandir-llvm
     42   1.1  joerg 
     43   1.1  joerg cleandir-llvm:
     44   1.9   matt 	test ! -d config || rm -r config
     45   1.1  joerg 	rm -f need-dl need-dl.tmp
     46   1.1  joerg 
     47   1.1  joerg .include <bsd.hostprog.mk>
     48