Makefile revision 1.16
11.16Sjoerg#	$NetBSD: Makefile,v 1.16 2013/02/20 14:13:31 joerg 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.15Sjoergrealdepends realall: config/config.status need-dl
131.1Sjoerg
141.1Sjoergconfig/config.status: ${LLVM_SRCDIR}/configure
151.1Sjoerg	mkdir -p config
161.16Sjoerg	printf '#!/bin/sh\necho 2.7.3' > config/python
171.16Sjoerg	chmod 755 config/python
181.15Sjoerg	cd config && ${LLVM_SRCDIR}/configure ${LLVM_CONFIGURE_ARGS} \
191.16Sjoerg	    --enable-optimized CC=${HOST_CC:Q} \
201.16Sjoerg	    --with-python=${.OBJDIR}/config/python
211.11Sjoerg# --disable-assertions
221.4Sjoerg
231.1Sjoergneed-dl:
241.1Sjoerg	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
251.1Sjoerg	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
261.1Sjoerg		echo > ${.TARGET}; \
271.1Sjoerg	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
281.1Sjoerg		echo -ldl > ${.TARGET}; \
291.1Sjoerg	else \
301.1Sjoerg		echo > ${.TARGET}; \
311.1Sjoerg	fi
321.1Sjoerg
331.1SjoergCLEANFILES+=	need-dl need-dl.c need-dl.out
341.1Sjoerg
351.1Sjoergcleandir: cleandir-llvm
361.1Sjoerg
371.1Sjoergcleandir-llvm:
381.9Smatt	test ! -d config || rm -r config
391.1Sjoerg	rm -f need-dl need-dl.tmp
401.1Sjoerg
411.1Sjoerg.include <bsd.hostprog.mk>
42