Home | History | Annotate | Line # | Download | only in llvm
Makefile revision 1.21.12.1
      1  1.21.12.1  pgoyette #	$NetBSD: Makefile,v 1.21.12.1 2018/05/02 07:20:27 pgoyette Exp $
      2        1.1     joerg 
      3  1.21.12.1  pgoyette .include <bsd.hostinit.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.17     joerg realdepends realall: config/config.status need-dl need-terminfo
     13        1.1     joerg 
     14        1.1     joerg config/config.status: ${LLVM_SRCDIR}/configure
     15        1.1     joerg 	mkdir -p config
     16       1.16     joerg 	printf '#!/bin/sh\necho 2.7.3' > config/python
     17       1.16     joerg 	chmod 755 config/python
     18       1.21     joerg 	cd config && ${HOST_SH} ${CONFIG_DIR}/configure ${LLVM_CONFIGURE_ARGS} \
     19       1.18      matt 	    --enable-optimized CC=${HOST_CC:Q} CXX=${HOST_CXX:Q} \
     20       1.16     joerg 	    --with-python=${.OBJDIR}/config/python
     21       1.11     joerg # --disable-assertions
     22        1.4     joerg 
     23        1.1     joerg need-dl:
     24        1.1     joerg 	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
     25        1.1     joerg 	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
     26        1.1     joerg 		echo > ${.TARGET}; \
     27        1.1     joerg 	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
     28        1.1     joerg 		echo -ldl > ${.TARGET}; \
     29        1.1     joerg 	else \
     30        1.1     joerg 		echo > ${.TARGET}; \
     31        1.1     joerg 	fi
     32        1.1     joerg 
     33       1.17     joerg need-terminfo:
     34       1.17     joerg 	printf '#include <term.h>\nint main(void){return setupterm(0, 0, 0);}' > need-terminfo.c
     35       1.17     joerg 	for lib in tinfo terminfo ncurses curses; do \
     36       1.17     joerg 		if ${HOST_CC} -o need-terminfo.out need-terminfo.c -l$$lib > /dev/null 2>&1; then \
     37       1.17     joerg 			echo -l$$lib > ${.TARGET}; \
     38       1.17     joerg 			break; \
     39       1.17     joerg 		fi; \
     40       1.17     joerg 	done
     41       1.17     joerg 
     42       1.17     joerg CLEANFILES+=	need-dl need-dl.c need-dl.out need-terminfo need-terminfo.c need-terminfo.out
     43        1.1     joerg 
     44        1.1     joerg cleandir: cleandir-llvm
     45        1.1     joerg 
     46       1.19     joerg cleandir-llvm: .PHONY
     47        1.9      matt 	test ! -d config || rm -r config
     48        1.1     joerg 	rm -f need-dl need-dl.tmp
     49        1.1     joerg 
     50        1.1     joerg .include <bsd.hostprog.mk>
     51