Annotation of src/Makefile, Revision 1.116
1.116 ! guenther 1: # $OpenBSD: Makefile,v 1.115 2010/03/23 21:31:02 espie Exp $
1.1 deraadt 2:
1.16 deraadt 3: #
4: # For more information on building in tricky environments, please see
5: # the list of possible environment variables described in
6: # /usr/share/mk/bsd.README.
1.85 todd 7: #
1.16 deraadt 8: # Building recommendations:
1.85 todd 9: #
1.16 deraadt 10: # 1) If at all possible, put this source tree in /usr/src. If /usr/src
1.113 jmc 11: # must be a symbolic link, set BSDSRCDIR in the environment to point to
12: # the real location.
1.16 deraadt 13: #
14: # 2) It is also recommended that you compile with objects outside the
15: # source tree. To do this, ensure /usr/obj exists or points to some
16: # area of disk of sufficient size. Then do "cd /usr/src; make obj".
17: # This will make a symbolic link called "obj" in each directory, as
18: # well as populate the /usr/obj properly with directories for the
19: # objects.
20: #
1.41 art 21: # 3) It is strongly recommended that you build and install a new kernel
22: # before rebuilding your system. Some of the new programs may use new
23: # functionality or depend on API changes that your old kernel doesn't have.
24: #
25: # 4) If you are reasonably sure that things will compile OK, use the
1.16 deraadt 26: # "make build" target supplied here. Good luck.
1.38 mickey 27: #
1.41 art 28: # 5) If you want to setup a cross-build environment, there is a "cross-tools"
1.85 todd 29: # target available which upon completion of "make TARGET=<target> cross-tools"
1.38 mickey 30: # (where <target> is one of the names in the /sys/arch directory) will produce
31: # a set of compilation tools along with the includes in the /usr/cross/<target>
1.87 wcobb 32: # directory. The "cross-distrib" target will build cross-tools as well as
33: # binaries for a given <target>.
1.38 mickey 34: #
1.16 deraadt 35:
1.6 mickey 36: .include <bsd.own.mk> # for NOMAN, if it's there.
1.1 deraadt 37:
38: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games
39: SUBDIR+= gnu
40:
1.114 deraadt 41: SUBDIR+= sys
1.1 deraadt 42:
1.68 hin 43: .if (${KERBEROS5:L} == "yes")
44: SUBDIR+= kerberosV
45: .endif
46:
1.21 deraadt 47: .if make(clean) || make(cleandir) || make(obj)
1.82 art 48: SUBDIR+= distrib regress
1.4 tholo 49: .endif
1.2 tholo 50:
1.1 deraadt 51: .if exists(regress)
52: regression-tests:
53: @echo Running regression tests...
1.83 art 54: @cd ${.CURDIR}/regress && ${MAKE} depend && exec ${MAKE} regress
1.1 deraadt 55: .endif
1.10 deraadt 56:
57: includes:
1.67 niklas 58: cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes
1.1 deraadt 59:
1.7 deraadt 60: beforeinstall:
1.66 espie 61: cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} distrib-dirs
1.115 espie 62: cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} install-mtree
1.66 espie 63: cd ${.CURDIR}/include && exec ${MAKE} includes
1.1 deraadt 64:
65: afterinstall:
66: .ifndef NOMAN
1.66 espie 67: cd ${.CURDIR}/share/man && exec ${MAKE} makedb
1.1 deraadt 68: .endif
69:
1.116 ! guenther 70: .ifdef DESTDIR
! 71: build:
! 72: @echo cannot build with DESTDIR set
! 73: @false
! 74: .else
1.1 deraadt 75: build:
1.19 kstailey 76: .ifdef GLOBAL_AUTOCONF_CACHE
1.60 angelos 77: cp /dev/null ${GLOBAL_AUTOCONF_CACHE}
1.18 kstailey 78: .endif
1.66 espie 79: cd ${.CURDIR}/share/mk && exec ${SUDO} ${MAKE} install
80: cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes
1.43 millert 81: ${SUDO} ${MAKE} cleandir
1.66 espie 82: cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && \
83: NOMAN=1 exec ${SUDO} ${MAKE} install
84: cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && \
85: NOMAN=1 exec ${SUDO} ${MAKE} install
86: ${MAKE} depend && ${MAKE} && exec ${SUDO} ${MAKE} install
1.116 ! guenther 87: .endif
1.15 niklas 88:
1.112 espie 89: CROSS_TARGETS=cross-env cross-dirs cross-obj cross-includes cross-binutils \
90: cross-gcc cross-tools cross-lib cross-bin cross-etc-root-var \
91: cross-depend cross-clean cross-cleandir
92:
1.15 niklas 93: .if !defined(TARGET)
1.112 espie 94: ${CROSS_TARGETS}:
95: @echo "TARGET must be set for $@"; exit 1
1.15 niklas 96: .else
1.112 espie 97: . include "Makefile.cross"
98: .endif # defined(TARGET)
1.106 grange 99:
1.112 espie 100: .PHONY: ${CROSS_TARGETS} \
101: build regression-tests includes beforeinstall afterinstall \
102: all depend
1.87 wcobb 103:
1.1 deraadt 104: .include <bsd.subdir.mk>