xref: /freebsd/tools/build/Makefile (revision 4acc8a67bad0a91dd9dbe07f2904a5dfdf313817)
130aaff11SWarner Losh# $FreeBSD$
230aaff11SWarner Losh
330aaff11SWarner Losh.PATH: ${.CURDIR}/../../include
430aaff11SWarner Losh
51c62f923SWarner LoshLIB=		egacy
6c2774610SDavid E. O'BrienSRC=
7d80f1dd1SJilles TjoelkerINCSGROUPS=	INCS SYSINCS
830aaff11SWarner LoshINCS=
930aaff11SWarner Losh
10d80f1dd1SJilles TjoelkerSYSINCSDIR=	${INCLUDEDIR}/sys
11d80f1dd1SJilles Tjoelker
1230aaff11SWarner LoshBOOTSTRAPPING?=	0
1330aaff11SWarner Losh
14804baa38SBryan Drewery_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/grp.h || true
1579626055SBrooks Davis.if ${_WITH_PWCACHEDB} == 0
1679626055SBrooks Davis.PATH: ${.CURDIR}/../../contrib/libc-pwcache
1779626055SBrooks DavisCFLAGS+=	-I${.CURDIR}/../../contrib/libc-pwcache \
1879626055SBrooks Davis		-I${.CURDIR}/../../lib/libc/include
1979626055SBrooks DavisSRCS+=		pwcache.c
2079626055SBrooks Davis.endif
2179626055SBrooks Davis
22804baa38SBryan Drewery_WITH_STRSVIS!=	grep -c strsvis /usr/include/vis.h || true
2379626055SBrooks Davis.if ${_WITH_STRSVIS} == 0
2479626055SBrooks Davis.PATH: ${.CURDIR}/../../contrib/libc-vis
2579626055SBrooks DavisSRCS+=		vis.c
2679626055SBrooks DavisCFLAGS+=	-I${.CURDIR}/../../contrib/libc-vis \
2779626055SBrooks Davis		-I${.CURDIR}/../../lib/libc/include
2879626055SBrooks Davis.endif
2979626055SBrooks Davis
30804baa38SBryan Drewery_WITH_REALLOCARRAY!= grep -c reallocarray /usr/include/stdlib.h || true
318e7e3163SDimitry Andric.if ${_WITH_REALLOCARRAY} == 0
328e7e3163SDimitry Andric.PATH: ${.CURDIR}/../../lib/libc/stdlib
338e7e3163SDimitry AndricINCS+=		stdlib.h
348e7e3163SDimitry AndricSRCS+=		reallocarray.c
358e7e3163SDimitry AndricCFLAGS+=	-I${.CURDIR}/../../lib/libc/include
368e7e3163SDimitry Andric.endif
378e7e3163SDimitry Andric
38d80f1dd1SJilles Tjoelker_WITH_UTIMENS!= grep -c utimensat /usr/include/sys/stat.h || true
39d80f1dd1SJilles Tjoelker.if ${_WITH_UTIMENS} == 0
40d80f1dd1SJilles TjoelkerSYSINCS+=	stat.h
41d80f1dd1SJilles TjoelkerSRCS+=		futimens.c utimensat.c
42d80f1dd1SJilles Tjoelker.endif
43d80f1dd1SJilles Tjoelker
448d14ced6SAlex Richardson_WITH_EXPLICIT_BZERO!= grep -c explicit_bzero /usr/include/strings.h || true
458d14ced6SAlex Richardson.if ${_WITH_EXPLICIT_BZERO} == 0
468d14ced6SAlex Richardson.PATH: ${SRCTOP}/sys/libkern
478d14ced6SAlex RichardsonINCS+=		strings.h
488d14ced6SAlex RichardsonSRCS+=		explicit_bzero.c
498d14ced6SAlex Richardson.endif
508d14ced6SAlex Richardson
5130aaff11SWarner Losh.if empty(SRCS)
5230aaff11SWarner LoshSRCS=		dummy.c
5330aaff11SWarner Losh.endif
5430aaff11SWarner Losh
55f09a3cc4SRuslan Ermilov.if defined(CROSS_BUILD_TESTING)
56f09a3cc4SRuslan ErmilovSUBDIR=		cross-build
57f09a3cc4SRuslan Ermilov.endif
58f09a3cc4SRuslan Ermilov
5963889bbdSAlex Richardson# Needed to build config (since it uses libnv)
6063889bbdSAlex RichardsonSYSINCS+=	${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h
6163889bbdSAlex Richardson
62*4acc8a67SAlex Richardson
63*4acc8a67SAlex Richardson# Create all the directories that are needed during the legacy, bootstrap-tools
64*4acc8a67SAlex Richardson# and cross-tools stages. We do this here using mkdir since mtree may not exist
65*4acc8a67SAlex Richardson# yet (this happens if we are crossbuilding from Linux/Mac).
66*4acc8a67SAlex Richardsoninstalldirs:
67*4acc8a67SAlex Richardson.for _dir in bin sbin usr/bin usr/sbin usr/lib usr/include lib/geom lib/casper
68*4acc8a67SAlex Richardson	mkdir -p "${DESTDIR}/${_dir}"
69*4acc8a67SAlex Richardson.endfor
70*4acc8a67SAlex Richardson
71*4acc8a67SAlex Richardson.for _group in ${INCSGROUPS:NINCS}
72*4acc8a67SAlex Richardson	mkdir -p "${DESTDIR}/${${_group}DIR}"
73*4acc8a67SAlex Richardson.endfor
74*4acc8a67SAlex Richardson
7530aaff11SWarner Losh.include <bsd.lib.mk>
76