Merge buildworld/installworld patch to Makefile from RELENG_2_2. Patch

a couple *.mk files to enable -current world building on really old
machines (e.g., 2.1.5).

Reviewed by:	too many many people to list here, special thanks to bde
This commit is contained in:
Satoshi Asami 1997-08-05 03:49:49 +00:00
parent 308f1befca
commit 2799473b0c
3 changed files with 232 additions and 124 deletions

348
Makefile
View File

@ -1,5 +1,5 @@
# #
# $Id: Makefile,v 1.131 1997/07/31 08:06:29 asami Exp $ # $Id: Makefile,v 1.132 1997/07/31 08:31:50 asami Exp $
# #
# Make command line options: # Make command line options:
# -DCLOBBER will remove /usr/include # -DCLOBBER will remove /usr/include
@ -22,8 +22,9 @@
# #
# The intended user-driven targets are: # The intended user-driven targets are:
# world - rebuild *everything*, including glue to help do upgrades. # buildworld - rebuild *everything*, including glue to help do upgrades
# reinstall - use an existing (eg: NFS mounted) build to do an update. # installworld- install everything built by "buildworld"
# world - buildworld + installworld
# update - convenient way to update your source tree (eg: sup/cvs) # update - convenient way to update your source tree (eg: sup/cvs)
# most - build user commands, no libraries or include files # most - build user commands, no libraries or include files
# installmost - install user commands, no libraries or include files # installmost - install user commands, no libraries or include files
@ -32,19 +33,14 @@
# /usr/share/mk. These include: # /usr/share/mk. These include:
# obj depend all install clean cleandepend cleanobj # obj depend all install clean cleandepend cleanobj
.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
.MAKEFLAGS:= ${.MAKEFLAGS} -m ${.CURDIR}/share/mk .MAKEFLAGS:= ${.MAKEFLAGS} -m ${.CURDIR}/share/mk
.endif
# Put initial settings here. # Put initial settings here.
SUBDIR= SUBDIR=
# We must do share/info early so that installation of info `dir' # We must do include and lib first so that the perl *.ph generation
# entries works correctly. Do it first since it is less likely to
# grow dependencies on include and lib than vice versa.
.if exists(share/info)
SUBDIR+= share/info
.endif
# We must do include and lib early so that the perl *.ph generation
# works correctly as it uses the header files installed by this. # works correctly as it uses the header files installed by this.
.if exists(include) .if exists(include)
SUBDIR+= include SUBDIR+= include
@ -122,8 +118,8 @@ CLEANDIR= cleandir
.endif .endif
.endif .endif
SUP?= sup SUP?= sup
SUPFLAGS?= -v SUPFLAGS?= -v
# #
# While building tools for bootstrapping, we dont need to waste time on # While building tools for bootstrapping, we dont need to waste time on
@ -144,82 +140,14 @@ world:
@echo "make world started on `LC_TIME=C date`" @echo "make world started on `LC_TIME=C date`"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
.if target(pre-world) .if target(pre-world)
@echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo " Making 'pre-world' target" @echo " Making 'pre-world' target"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} pre-world cd ${.CURDIR} && ${MAKE} pre-world
@echo
.endif .endif
@echo "--------------------------------------------------------------" cd ${.CURDIR} && ${MAKE} buildworld
@echo " Making hierarchy" cd ${.CURDIR} && ${MAKE} installworld
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} hierarchy
@echo
@echo "--------------------------------------------------------------"
@echo " Cleaning up the source tree"
@echo "--------------------------------------------------------------"
.if defined(NOCLEAN)
@echo "Not cleaning anything! I sure hope you know what you are doing!"
.else
cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
.endif
@echo
.if !defined(NOOBJDIR)
@echo "--------------------------------------------------------------"
@echo " Rebuilding the obj tree"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} obj
@echo
.endif
@echo "--------------------------------------------------------------"
@echo " Rebuilding bootstrap tools"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} bootstrap
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding tools necessary to build the include files"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} include-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding /usr/include"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} includes
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding tools needed to build the libraries"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} lib-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding /usr/lib"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} libraries
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding symorder, groff and zic(8)"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} build-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding dependencies"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} depend
@echo
@echo "--------------------------------------------------------------"
@echo " Building everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} all
@echo
@echo "--------------------------------------------------------------"
@echo " Installing everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${MAKE} install
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding man page indexes"
@echo "--------------------------------------------------------------"
cd ${.CURDIR}/share/man && ${MAKE} makedb
.if target(post-world) .if target(post-world)
@echo @echo
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@ -232,6 +160,132 @@ world:
@echo "make world completed on `LC_TIME=C date`" @echo "make world completed on `LC_TIME=C date`"
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
.if defined(MAKEOBJDIRPREFIX)
WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
.else
WORLDTMP= /usr/obj${.CURDIR}/tmp
.endif
STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
TMPPATH= ${STRICTTMPPATH}:${PATH}
# XXX COMPILER_PATH is needed for finding cc1, ld and as
# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now
# tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
# wouldn't link *crt.o or libgcc if it were used.
# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
# want that - all compile-time library paths should be resolved by gcc.
# It fails for set[ug]id executables (are any used?).
COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
GCC_EXEC_PREFIX=${WORLDTMP}/usr/lib/ \
LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
CC='cc -nostdinc' # XXX -nostdlib
# used to compile and install 'make' in temporary build tree
IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
# bootstrap make
BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
# cross make used for compilation
XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
# cross make used for final installation
IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE}
#
# buildworld
#
# Attempt to rebuild the entire system, with reasonable chance of
# success, regardless of how old your existing system is.
#
buildworld:
.if !defined(NOCLEAN)
@echo
@echo "--------------------------------------------------------------"
@echo " Cleaning up the temporary build tree"
@echo "--------------------------------------------------------------"
mkdir -p ${WORLDTMP}
chflags -R noschg ${WORLDTMP}/
rm -rf ${WORLDTMP}
.endif
@echo
@echo "--------------------------------------------------------------"
@echo " Making make"
@echo "--------------------------------------------------------------"
mkdir -p ${WORLDTMP}/usr/bin
cd ${.CURDIR}/usr.bin/make && \
${IBMAKE} -I${.CURDIR}/share/mk ${OBJDIR} clean cleandepend depend && \
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all install clean cleandepend
@echo
@echo "--------------------------------------------------------------"
@echo " Making hierarchy"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} hierarchy
.if !defined(NOCLEAN)
@echo
@echo "--------------------------------------------------------------"
@echo " Cleaning up the obj tree"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} ${CLEANDIR}
.endif
.if !defined(NOOBJDIR)
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding the obj tree"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} obj
.endif
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding bootstrap tools"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} bootstrap
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding tools necessary to build the include files"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} include-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding /usr/include"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} includes
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding tools needed to build the libraries"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} lib-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding /usr/lib"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} libraries
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding all other tools needed to build the world"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${BMAKE} build-tools
@echo
@echo "--------------------------------------------------------------"
@echo " Rebuilding dependencies"
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${XMAKE} depend
@echo
@echo "--------------------------------------------------------------"
@echo " Building everything.."
@echo "--------------------------------------------------------------"
cd ${.CURDIR} && ${XMAKE} all
#
# installworld
#
# Installs everything compiled by a 'buildworld'.
#
installworld:
cd ${.CURDIR} && ${IXMAKE} reinstall
# #
# reinstall # reinstall
# #
@ -255,7 +309,6 @@ reinstall:
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
cd ${.CURDIR}/share/man && ${MAKE} makedb cd ${.CURDIR}/share/man && ${MAKE} makedb
# #
# update # update
# #
@ -282,7 +335,6 @@ update:
cd ${.CURDIR} && cvs -q update -P -d cd ${.CURDIR} && cvs -q update -P -d
.endif .endif
# #
# most # most
# #
@ -355,6 +407,12 @@ hierarchy:
# for the dependency information to be gathered from. # for the dependency information to be gathered from.
# #
bootstrap: bootstrap:
.if defined(DESTDIR)
rm -f ${DESTDIR}/usr/src/sys
ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include
cd ${.CURDIR}/include && make symlinks
.endif
cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \ cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \ cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
@ -366,11 +424,13 @@ bootstrap:
# include-tools - generally the same as 'bootstrap', except that it's for # include-tools - generally the same as 'bootstrap', except that it's for
# things that are specifically needed to generate include files. # things that are specifically needed to generate include files.
# #
# XXX should be merged with bootstrap, it's not worth keeeping them seperate # XXX should be merged with bootstrap, it's not worth keeeping them separate.
# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
# on cleaned away headers in ${WORLDTMP}.
# #
include-tools: include-tools:
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \ cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} cleandepend depend && \
${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR} ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
# #
# includes - possibly generate and install the include files. # includes - possibly generate and install the include files.
@ -388,7 +448,6 @@ includes:
cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
cd ${.CURDIR}/gnu/lib/libmp && ${MAKE} beforeinstall
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES) .if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
@ -420,34 +479,26 @@ includes:
# #
# lib-tools - build tools to compile and install the libraries. # lib-tools - build tools to compile and install the libraries.
# #
# XXX gperf is required for cc
# XXX a new ld and tsort is required for cc
lib-tools: lib-tools:
cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \ .for d in \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} gnu/usr.bin/gperf \
cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \ gnu/usr.bin/ld \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} usr.bin/tsort \
cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \ gnu/usr.bin/as \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} gnu/usr.bin/bison \
cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \ gnu/usr.bin/cc \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} usr.bin/ar \
cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \ usr.bin/compile_et \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} usr.bin/lex/lib \
cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \ usr.bin/mk_cmds \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} usr.bin/nm \
cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \ usr.bin/ranlib \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} usr.bin/uudecode
cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \ cd ${.CURDIR}/$d && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
rm -f /usr/sbin/compile_et
cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/usr.bin/uudecode && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
.endfor
# #
# libraries - build and install the libraries # libraries - build and install the libraries
@ -497,15 +548,70 @@ libraries:
# #
# build-tools - build and install any other tools needed to complete the # build-tools - build and install any other tools needed to complete the
# compile and install. # compile and install.
# ifdef stale
# bc and cpp are required to build groff. Otherwise, the order here is
# mostly historical, i.e., bogus.
# chmod is used to build gcc's tmpmultilib[2] at obscure times.
# endif stale
# XXX uname is a bug - the target should not depend on the host.
# #
build-tools: build-tools:
.for d in \ .for d in \
share/info \ bin/cat \
gnu/usr.bin/texinfo \ bin/chmod \
usr.bin/symorder \ bin/cp \
usr.sbin/zic \ bin/date \
bin/dd \
bin/echo \
bin/expr \
bin/hostname \
bin/ln \
bin/ls \
bin/mkdir \
bin/mv \
bin/rm \
bin/sh \
bin/test \
gnu/usr.bin/awk \ gnu/usr.bin/awk \
gnu/usr.bin/groff gnu/usr.bin/bc \
gnu/usr.bin/grep \
gnu/usr.bin/groff \
gnu/usr.bin/gzip \
gnu/usr.bin/man/makewhatis \
gnu/usr.bin/sort \
gnu/usr.bin/texinfo \
share/info \
usr.bin/basename \
usr.bin/cap_mkdb \
usr.bin/chflags \
usr.bin/cmp \
usr.bin/col \
usr.bin/cpp \
usr.bin/expand \
usr.bin/file2c \
usr.bin/find \
usr.bin/gencat \
usr.bin/lorder \
usr.bin/m4 \
usr.bin/mkdep \
usr.bin/paste \
usr.bin/sed \
usr.bin/size \
usr.bin/soelim \
usr.bin/strip \
usr.bin/symorder \
usr.bin/touch \
usr.bin/tr \
usr.bin/true \
usr.bin/uname \
usr.bin/uuencode \
usr.bin/vgrind \
usr.bin/vi \
usr.bin/wc \
usr.bin/yacc \
usr.sbin/chown \
usr.sbin/mtree \
usr.sbin/zic
cd ${.CURDIR}/$d && ${MAKE} depend && \ cd ${.CURDIR}/$d && ${MAKE} depend && \
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} ${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
.endfor .endfor

View File

@ -1,5 +1,5 @@
# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
# $Id: bsd.lib.mk,v 1.58 1997/06/18 03:39:34 asami Exp $ # $Id: bsd.lib.mk,v 1.59 1997/06/21 15:40:32 jkh Exp $
# #
.if exists(${.CURDIR}/../Makefile.inc) .if exists(${.CURDIR}/../Makefile.inc)
@ -186,10 +186,12 @@ _EXTRADEPEND::
> $$TMP; \ > $$TMP; \
mv $$TMP ${DEPENDFILE} mv $$TMP ${DEPENDFILE}
.endif .endif
.if !defined(NOEXTRADEPEND)
_EXTRADEPEND:: _EXTRADEPEND::
echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \ echo lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}: \
`${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \ `${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \
>> ${DEPENDFILE} >> ${DEPENDFILE}
.endif
.if !target(install) .if !target(install)
.if !target(beforeinstall) .if !target(beforeinstall)

View File

@ -1,5 +1,5 @@
# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91
# $Id: bsd.prog.mk,v 1.52 1997/06/28 08:14:10 pst Exp $ # $Id: bsd.prog.mk,v 1.53 1997/07/31 06:12:04 asami Exp $
.if exists(${.CURDIR}/../Makefile.inc) .if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc" .include "${.CURDIR}/../Makefile.inc"
@ -63,7 +63,7 @@ clean: _SUBDIR
.endif .endif
.endif .endif
.if defined(PROG) .if defined(PROG) && !defined(NOEXTRADEPEND)
_EXTRADEPEND: _EXTRADEPEND:
echo ${PROG}: `${CC} -Wl,-f ${CFLAGS} ${LDFLAGS} ${LDDESTDIR} \ echo ${PROG}: `${CC} -Wl,-f ${CFLAGS} ${LDFLAGS} ${LDDESTDIR} \
${LDADD:S/^/-Wl,/}` >> ${DEPENDFILE} ${LDADD:S/^/-Wl,/}` >> ${DEPENDFILE}