=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/Makefile,v retrieving revision 1.119 retrieving revision 1.136 diff -u -r1.119 -r1.136 --- src/Makefile 2013/06/17 19:16:02 1.119 +++ src/Makefile 2020/04/05 20:14:14 1.136 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.119 2013/06/17 19:16:02 robert Exp $ +# $OpenBSD: Makefile,v 1.136 2020/04/05 20:14:14 deraadt Exp $ # # For more information on building in tricky environments, please see @@ -27,7 +27,7 @@ # # 5) If you want to setup a cross-build environment, there is a "cross-gcc" # target available which upon completion of: -# make -f Makefile.cross TARGET= cross-gcc" +# "make -f Makefile.cross TARGET= cross-gcc" # (where 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/ # directory. The "cross-distrib" target will build cross-tools as well as @@ -41,15 +41,8 @@ SUBDIR+= sys -.if (${KERBEROS5:L} == "yes") -SUBDIR+=kerberosV/tools -SUBDIR+=kerberosV/libexec -SUBDIR+=kerberosV/usr.bin -SUBDIR+=kerberosV/usr.sbin -.endif - .if make(clean) || make(cleandir) || make(obj) -SUBDIR+= distrib regress +SUBDIR+= etc distrib regress .endif regression-tests: @@ -57,7 +50,9 @@ @cd ${.CURDIR}/regress && ${MAKE} depend && exec ${MAKE} regress includes: - cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes + cd ${.CURDIR}/include && \ + su ${BUILDUSER} -c 'exec ${MAKE} prereq' && \ + exec ${MAKE} includes beforeinstall: cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} distrib-dirs @@ -67,6 +62,7 @@ afterinstall: .ifndef NOMAN cd ${.CURDIR}/share/man && exec ${MAKE} makedb + cd ${.CURDIR}/distrib/sets && exec ${MAKE} makedb .endif .ifdef DESTDIR @@ -75,17 +71,31 @@ @false .else build: + umask ${WOBJUMASK}; exec ${MAKE} do-build + +do-build: .ifdef GLOBAL_AUTOCONF_CACHE - cp /dev/null ${GLOBAL_AUTOCONF_CACHE} + ${INSTALL} -c -o ${BUILDUSER} -g ${WOBJGROUP} -m 664 /dev/null \ + ${GLOBAL_AUTOCONF_CACHE} .endif - cd ${.CURDIR}/share/mk && exec ${SUDO} ${MAKE} install - cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes - ${SUDO} ${MAKE} cleandir - cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && \ - NOMAN=1 exec ${SUDO} ${MAKE} install - cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && \ - NOMAN=1 exec ${SUDO} ${MAKE} install - ${MAKE} depend && ${MAKE} && exec ${SUDO} ${MAKE} install + @if [[ `id -u` -ne 0 ]]; then \ + echo $@ must be called by root >&2; \ + false; \ + fi + cd ${.CURDIR}/share/mk && exec ${MAKE} install + exec ${MAKE} cleandir + exec ${MAKE} includes + cd ${.CURDIR}/lib && \ + su ${BUILDUSER} -c 'exec ${MAKE}' && \ + NOMAN=1 exec ${MAKE} install + /sbin/ldconfig -R + cd ${.CURDIR}/gnu/lib && \ + su ${BUILDUSER} -c 'exec ${MAKE}' && \ + NOMAN=1 exec ${MAKE} install + /sbin/ldconfig -R + su ${BUILDUSER} -c 'exec ${MAKE}' && \ + exec ${MAKE} install + /bin/sh ${.CURDIR}/distrib/sets/makeetcset ${.CURDIR} ${MAKE} .endif CROSS_TARGETS=cross-env cross-dirs cross-obj cross-includes cross-binutils \ @@ -101,6 +111,6 @@ .PHONY: ${CROSS_TARGETS} \ build regression-tests includes beforeinstall afterinstall \ - all depend + all do-build .include