2020-04-05 13:14:14 -07:00
|
|
|
# $OpenBSD: Makefile,v 1.136 2020/04/05 20:14:14 deraadt Exp $
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1997-04-17 23:47:08 -07:00
|
|
|
#
|
|
|
|
# For more information on building in tricky environments, please see
|
|
|
|
# the list of possible environment variables described in
|
|
|
|
# /usr/share/mk/bsd.README.
|
2002-06-08 22:47:26 -07:00
|
|
|
#
|
1997-04-17 23:47:08 -07:00
|
|
|
# Building recommendations:
|
2002-06-08 22:47:26 -07:00
|
|
|
#
|
1997-04-17 23:47:08 -07:00
|
|
|
# 1) If at all possible, put this source tree in /usr/src. If /usr/src
|
2005-09-16 05:28:34 -07:00
|
|
|
# must be a symbolic link, set BSDSRCDIR in the environment to point to
|
|
|
|
# the real location.
|
1997-04-17 23:47:08 -07:00
|
|
|
#
|
|
|
|
# 2) It is also recommended that you compile with objects outside the
|
|
|
|
# source tree. To do this, ensure /usr/obj exists or points to some
|
|
|
|
# area of disk of sufficient size. Then do "cd /usr/src; make obj".
|
|
|
|
# This will make a symbolic link called "obj" in each directory, as
|
|
|
|
# well as populate the /usr/obj properly with directories for the
|
|
|
|
# objects.
|
|
|
|
#
|
1998-09-30 06:27:28 -07:00
|
|
|
# 3) It is strongly recommended that you build and install a new kernel
|
|
|
|
# before rebuilding your system. Some of the new programs may use new
|
|
|
|
# functionality or depend on API changes that your old kernel doesn't have.
|
|
|
|
#
|
|
|
|
# 4) If you are reasonably sure that things will compile OK, use the
|
1997-04-17 23:47:08 -07:00
|
|
|
# "make build" target supplied here. Good luck.
|
1998-05-18 11:29:07 -07:00
|
|
|
#
|
2011-09-17 09:59:53 -07:00
|
|
|
# 5) If you want to setup a cross-build environment, there is a "cross-gcc"
|
|
|
|
# target available which upon completion of:
|
2015-06-01 23:10:14 -07:00
|
|
|
# "make -f Makefile.cross TARGET=<target> cross-gcc"
|
1998-05-18 11:29:07 -07:00
|
|
|
# (where <target> is one of the names in the /sys/arch directory) will produce
|
|
|
|
# a set of compilation tools along with the includes in the /usr/cross/<target>
|
2002-08-15 19:04:58 -07:00
|
|
|
# directory. The "cross-distrib" target will build cross-tools as well as
|
|
|
|
# binaries for a given <target>.
|
1998-05-18 11:29:07 -07:00
|
|
|
#
|
1996-04-23 02:47:22 -07:00
|
|
|
|
1997-04-17 23:47:08 -07:00
|
|
|
.include <bsd.own.mk> # for NOMAN, if it's there.
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games
|
|
|
|
SUBDIR+= gnu
|
|
|
|
|
2005-12-01 17:17:20 -08:00
|
|
|
SUBDIR+= sys
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1997-08-06 02:40:10 -07:00
|
|
|
.if make(clean) || make(cleandir) || make(obj)
|
2015-08-23 07:22:56 -07:00
|
|
|
SUBDIR+= etc distrib regress
|
1997-08-06 02:40:10 -07:00
|
|
|
.endif
|
|
|
|
|
1995-10-18 01:37:01 -07:00
|
|
|
regression-tests:
|
|
|
|
@echo Running regression tests...
|
2002-02-22 15:31:11 -08:00
|
|
|
@cd ${.CURDIR}/regress && ${MAKE} depend && exec ${MAKE} regress
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1996-05-17 22:37:48 -07:00
|
|
|
includes:
|
2016-10-06 09:22:43 -07:00
|
|
|
cd ${.CURDIR}/include && \
|
|
|
|
su ${BUILDUSER} -c 'exec ${MAKE} prereq' && \
|
|
|
|
exec ${MAKE} includes
|
1996-05-17 22:37:48 -07:00
|
|
|
|
1996-05-06 13:31:44 -07:00
|
|
|
beforeinstall:
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} distrib-dirs
|
2010-03-23 14:31:02 -07:00
|
|
|
cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} install-mtree
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/include && exec ${MAKE} includes
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
afterinstall:
|
|
|
|
.ifndef NOMAN
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/share/man && exec ${MAKE} makedb
|
2014-07-09 12:23:28 -07:00
|
|
|
cd ${.CURDIR}/distrib/sets && exec ${MAKE} makedb
|
1995-10-18 01:37:01 -07:00
|
|
|
.endif
|
|
|
|
|
2011-04-24 15:04:43 -07:00
|
|
|
.ifdef DESTDIR
|
|
|
|
build:
|
|
|
|
@echo cannot build with DESTDIR set
|
|
|
|
@false
|
|
|
|
.else
|
1995-10-18 01:37:01 -07:00
|
|
|
build:
|
2016-11-19 06:20:58 -08:00
|
|
|
umask ${WOBJUMASK}; exec ${MAKE} do-build
|
|
|
|
|
|
|
|
do-build:
|
1997-07-28 20:37:03 -07:00
|
|
|
.ifdef GLOBAL_AUTOCONF_CACHE
|
2017-01-29 09:06:56 -08:00
|
|
|
${INSTALL} -c -o ${BUILDUSER} -g ${WOBJGROUP} -m 664 /dev/null \
|
|
|
|
${GLOBAL_AUTOCONF_CACHE}
|
1997-07-28 20:18:39 -07:00
|
|
|
.endif
|
2016-10-05 11:00:41 -07:00
|
|
|
@if [[ `id -u` -ne 0 ]]; then \
|
2016-10-06 11:56:17 -07:00
|
|
|
echo $@ must be called by root >&2; \
|
2016-10-05 11:00:41 -07:00
|
|
|
false; \
|
|
|
|
fi
|
2016-10-04 09:54:31 -07:00
|
|
|
cd ${.CURDIR}/share/mk && exec ${MAKE} install
|
2016-10-06 09:22:43 -07:00
|
|
|
exec ${MAKE} cleandir
|
2016-10-17 19:47:07 -07:00
|
|
|
exec ${MAKE} includes
|
2016-10-05 11:00:41 -07:00
|
|
|
cd ${.CURDIR}/lib && \
|
2017-07-05 03:22:32 -07:00
|
|
|
su ${BUILDUSER} -c 'exec ${MAKE}' && \
|
2016-10-04 09:54:31 -07:00
|
|
|
NOMAN=1 exec ${MAKE} install
|
2020-04-05 13:14:14 -07:00
|
|
|
/sbin/ldconfig -R
|
2016-10-05 11:00:41 -07:00
|
|
|
cd ${.CURDIR}/gnu/lib && \
|
2017-07-05 03:22:32 -07:00
|
|
|
su ${BUILDUSER} -c 'exec ${MAKE}' && \
|
2016-10-04 09:54:31 -07:00
|
|
|
NOMAN=1 exec ${MAKE} install
|
2020-04-05 13:14:14 -07:00
|
|
|
/sbin/ldconfig -R
|
2017-07-05 03:22:32 -07:00
|
|
|
su ${BUILDUSER} -c 'exec ${MAKE}' && \
|
2016-10-05 11:00:41 -07:00
|
|
|
exec ${MAKE} install
|
2016-10-04 09:54:31 -07:00
|
|
|
/bin/sh ${.CURDIR}/distrib/sets/makeetcset ${.CURDIR} ${MAKE}
|
2011-04-24 15:04:43 -07:00
|
|
|
.endif
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2005-01-09 12:36:20 -08:00
|
|
|
CROSS_TARGETS=cross-env cross-dirs cross-obj cross-includes cross-binutils \
|
|
|
|
cross-gcc cross-tools cross-lib cross-bin cross-etc-root-var \
|
|
|
|
cross-depend cross-clean cross-cleandir
|
1998-05-11 00:43:12 -07:00
|
|
|
|
2005-01-09 12:36:20 -08:00
|
|
|
.if !defined(TARGET)
|
|
|
|
${CROSS_TARGETS}:
|
|
|
|
@echo "TARGET must be set for $@"; exit 1
|
2004-10-21 13:47:29 -07:00
|
|
|
.else
|
2005-01-09 12:36:20 -08:00
|
|
|
. include "Makefile.cross"
|
|
|
|
.endif # defined(TARGET)
|
2002-08-15 19:04:58 -07:00
|
|
|
|
2005-01-09 12:36:20 -08:00
|
|
|
.PHONY: ${CROSS_TARGETS} \
|
|
|
|
build regression-tests includes beforeinstall afterinstall \
|
2019-12-21 13:39:59 -08:00
|
|
|
all do-build
|
2002-08-15 19:04:58 -07:00
|
|
|
|
1995-10-18 01:37:01 -07:00
|
|
|
.include <bsd.subdir.mk>
|