Makefile revision 1.10
11.10Sadam#	$NetBSD: Makefile,v 1.10 2011/07/18 18:37:15 adam Exp $
21.1Sjoerg
31.1Sjoerg.include <bsd.init.mk>
41.1Sjoerg
51.1Sjoerg#
61.1Sjoerg# Do *not* set HOSTPROG or HOSTLIB at this point otherwise
71.1Sjoerg# it will create a loop trying to extract the object directory.
81.1Sjoerg#
91.1Sjoerg.include "Makefile.inc"
101.1Sjoerg.include "${LLVM_TOPLEVEL}/lib/Makefile.inc"
111.1Sjoerg
121.1Sjoergrealdepends realall: config/config.status need-dl \
131.1Sjoerg	config/include/clang/Basic/Version.inc
141.1Sjoerg
151.1Sjoergconfig/include/clang/Basic/Version.inc: \
161.1Sjoerg	${LLVM_TOPLEVEL}/config/clang/Basic/Version.inc
171.1Sjoerg	mkdir -p ${.TARGET:H}
181.1Sjoerg	cat < ${.ALLSRC} > ${.TARGET}
191.1Sjoerg
201.1Sjoergconfig/config.status: ${LLVM_SRCDIR}/configure
211.1Sjoerg	mkdir -p config
221.10Sadam	cd config && ${LLVM_SRCDIR}/configure CC=${HOST_CC:Q} --prefix=/usr \
231.10Sadam	    --enable-targets=x86,powerpc,sparc,arm,mips \
241.10Sadam	    --host=${MACHINE_GNU_PLATFORM} \
251.4Sjoerg	    --with-c-include-dirs=/usr/include/clang-3.0:/usr/include \
261.10Sadam	    --enable-optimized --disable-assertions
271.4Sjoerg
281.1Sjoergneed-dl:
291.1Sjoerg	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
301.1Sjoerg	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
311.1Sjoerg		echo > ${.TARGET}; \
321.1Sjoerg	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
331.1Sjoerg		echo -ldl > ${.TARGET}; \
341.1Sjoerg	else \
351.1Sjoerg		echo > ${.TARGET}; \
361.1Sjoerg	fi
371.1Sjoerg
381.1SjoergCLEANFILES+=	need-dl need-dl.c need-dl.out
391.1Sjoerg
401.1Sjoergcleandir: cleandir-llvm
411.1Sjoerg
421.1Sjoergcleandir-llvm:
431.9Smatt	test ! -d config || rm -r config
441.1Sjoerg	rm -f need-dl need-dl.tmp
451.1Sjoerg
461.1Sjoerg.include <bsd.hostprog.mk>
47