Home | History | Annotate | Line # | Download | only in llvm
      1  1.24     joerg #	$NetBSD: Makefile,v 1.24 2021/05/30 01:57:00 joerg Exp $
      2   1.1     joerg 
      3  1.22  christos .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.24     joerg realdepends realall: config/config.status need-dl need-terminfo support-modules
     13  1.24     joerg 
     14  1.24     joerg dependall: clean-modulecache
     15  1.24     joerg 
     16  1.24     joerg clean-modulecache:
     17  1.24     joerg 	rm -rf ${LLVM_MODULE_CACHE}
     18   1.1     joerg 
     19   1.1     joerg config/config.status: ${LLVM_SRCDIR}/configure
     20   1.1     joerg 	mkdir -p config
     21  1.16     joerg 	printf '#!/bin/sh\necho 2.7.3' > config/python
     22  1.16     joerg 	chmod 755 config/python
     23  1.21     joerg 	cd config && ${HOST_SH} ${CONFIG_DIR}/configure ${LLVM_CONFIGURE_ARGS} \
     24  1.18      matt 	    --enable-optimized CC=${HOST_CC:Q} CXX=${HOST_CXX:Q} \
     25  1.24     joerg 	    --with-python=${.OBJDIR}/config/python && \
     26  1.24     joerg 	cp ${LLVM_TOPLEVEL}/include/module.modulemap include/llvm/module.modulemap
     27  1.24     joerg 
     28  1.24     joerg support-modules: module-test.cpp Makefile
     29  1.24     joerg 	if ${HOST_CXX} -stdlib=libc++ -c -fmodules -fcxx-modules -fmodules-cache-path=./module.cache \
     30  1.24     joerg 	   ${.CURDIR}/module-test.cpp  3> /dev/null 2>&1; then \
     31  1.24     joerg 		echo HOST_SUPPORTS_MODULES=yes > ${.TARGET}; \
     32  1.24     joerg 	else \
     33  1.24     joerg 		echo HOST_SUPPORTS_MODULES=no > ${.TARGET}; \
     34  1.24     joerg 	fi
     35   1.4     joerg 
     36  1.23     joerg need-dl: Makefile
     37   1.1     joerg 	printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
     38   1.1     joerg 	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
     39   1.1     joerg 		echo > ${.TARGET}; \
     40   1.1     joerg 	elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
     41   1.1     joerg 		echo -ldl > ${.TARGET}; \
     42   1.1     joerg 	else \
     43   1.1     joerg 		echo > ${.TARGET}; \
     44   1.1     joerg 	fi
     45   1.1     joerg 
     46  1.23     joerg need-terminfo: Makefile
     47  1.23     joerg 	printf 'int setupterm(char *, int, int *);\nint main(void){return setupterm("", 0, 0);}' > need-terminfo.c
     48  1.17     joerg 	for lib in tinfo terminfo ncurses curses; do \
     49  1.17     joerg 		if ${HOST_CC} -o need-terminfo.out need-terminfo.c -l$$lib > /dev/null 2>&1; then \
     50  1.17     joerg 			echo -l$$lib > ${.TARGET}; \
     51  1.17     joerg 			break; \
     52  1.17     joerg 		fi; \
     53  1.17     joerg 	done
     54  1.17     joerg 
     55  1.17     joerg CLEANFILES+=	need-dl need-dl.c need-dl.out need-terminfo need-terminfo.c need-terminfo.out
     56   1.1     joerg 
     57   1.1     joerg cleandir: cleandir-llvm
     58   1.1     joerg 
     59  1.19     joerg cleandir-llvm: .PHONY
     60   1.9      matt 	test ! -d config || rm -r config
     61  1.24     joerg 	test ! -d module-cache || rm -r module-cache
     62  1.24     joerg 	rm -f need-dl need-dl.tmp module-cache module-test.o
     63   1.1     joerg 
     64   1.1     joerg .include <bsd.hostprog.mk>
     65