[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / src

Annotation of src/Makefile, Revision 1.132

1.132   ! rpe         1: #      $OpenBSD: Makefile,v 1.131 2016/11/19 14:20:58 tb 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.117     pirofti    28: # 5) If you want to setup a cross-build environment, there is a "cross-gcc"
                     29: # target available which upon completion of:
1.124     deraadt    30: #      "make -f Makefile.cross TARGET=<target> cross-gcc"
1.38      mickey     31: # (where <target> is one of the names in the /sys/arch directory) will produce
                     32: # a set of compilation tools along with the includes in the /usr/cross/<target>
1.87      wcobb      33: # directory. The "cross-distrib" target will build cross-tools as well as
                     34: # binaries for a given <target>.
1.38      mickey     35: #
1.16      deraadt    36:
1.6       mickey     37: .include <bsd.own.mk>  # for NOMAN, if it's there.
1.1       deraadt    38:
                     39: SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games
                     40: SUBDIR+= gnu
                     41:
1.114     deraadt    42: SUBDIR+= sys
1.68      hin        43:
1.21      deraadt    44: .if   make(clean) || make(cleandir) || make(obj)
1.125     deraadt    45: SUBDIR+= etc distrib regress
1.4       tholo      46: .endif
1.2       tholo      47:
1.1       deraadt    48: regression-tests:
                     49:        @echo Running regression tests...
1.83      art        50:        @cd ${.CURDIR}/regress && ${MAKE} depend && exec ${MAKE} regress
1.10      deraadt    51:
                     52: includes:
1.128     tb         53:        cd ${.CURDIR}/include && \
                     54:                su ${BUILDUSER} -c 'exec ${MAKE} prereq' && \
                     55:                exec ${MAKE} includes
1.1       deraadt    56:
1.7       deraadt    57: beforeinstall:
1.66      espie      58:        cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} distrib-dirs
1.115     espie      59:        cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} install-mtree
1.66      espie      60:        cd ${.CURDIR}/include && exec ${MAKE} includes
1.1       deraadt    61:
                     62: afterinstall:
                     63: .ifndef NOMAN
1.66      espie      64:        cd ${.CURDIR}/share/man && exec ${MAKE} makedb
1.122     espie      65:        cd ${.CURDIR}/distrib/sets && exec ${MAKE} makedb
1.1       deraadt    66: .endif
                     67:
1.116     guenther   68: .ifdef DESTDIR
                     69: build:
                     70:        @echo cannot build with DESTDIR set
                     71:        @false
                     72: .else
1.1       deraadt    73: build:
1.131     tb         74:        umask ${WOBJUMASK}; exec ${MAKE} do-build
                     75:
                     76: do-build:
1.19      kstailey   77: .ifdef GLOBAL_AUTOCONF_CACHE
1.132   ! rpe        78:        ${INSTALL} -c -o ${BUILDUSER} -g ${WOBJGROUP} -m 664 /dev/null \
        !            79:            ${GLOBAL_AUTOCONF_CACHE}
1.18      kstailey   80: .endif
1.127     natano     81:        @if [[ `id -u` -ne 0 ]]; then \
1.129     natano     82:                echo $@ must be called by root >&2; \
1.127     natano     83:                false; \
                     84:        fi
1.126     deraadt    85:        cd ${.CURDIR}/share/mk && exec ${MAKE} install
1.130     tb         86:        exec ${MAKE} cleandir
1.128     tb         87:        exec ${MAKE} includes
1.127     natano     88:        cd ${.CURDIR}/lib && \
                     89:            su ${BUILDUSER} -c '${MAKE} depend && exec ${MAKE}' && \
1.126     deraadt    90:            NOMAN=1 exec ${MAKE} install
1.127     natano     91:        cd ${.CURDIR}/gnu/lib && \
                     92:            su ${BUILDUSER} -c '${MAKE} depend && exec ${MAKE}' && \
1.126     deraadt    93:            NOMAN=1 exec ${MAKE} install
1.127     natano     94:        su ${BUILDUSER} -c '${MAKE} depend && exec ${MAKE}' && \
                     95:            exec ${MAKE} install
1.126     deraadt    96:        /bin/sh ${.CURDIR}/distrib/sets/makeetcset ${.CURDIR} ${MAKE}
1.116     guenther   97: .endif
1.15      niklas     98:
1.112     espie      99: CROSS_TARGETS=cross-env cross-dirs cross-obj cross-includes cross-binutils \
                    100:        cross-gcc cross-tools cross-lib cross-bin cross-etc-root-var \
                    101:        cross-depend cross-clean cross-cleandir
                    102:
1.15      niklas    103: .if !defined(TARGET)
1.112     espie     104: ${CROSS_TARGETS}:
                    105:        @echo "TARGET must be set for $@"; exit 1
1.15      niklas    106: .else
1.112     espie     107: . include "Makefile.cross"
                    108: .endif # defined(TARGET)
1.106     grange    109:
1.112     espie     110: .PHONY: ${CROSS_TARGETS} \
                    111:        build regression-tests includes beforeinstall afterinstall \
                    112:        all depend
1.87      wcobb     113:
1.1       deraadt   114: .include <bsd.subdir.mk>