Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Major overhaul of src/tools and host toolchain. Summary of ...



details:   https://anonhg.NetBSD.org/src/rev/711c709a2e2f
branches:  trunk
changeset: 517431:711c709a2e2f
user:      tv <tv%NetBSD.org@localhost>
date:      Mon Nov 12 23:16:17 2001 +0000

description:
Major overhaul of src/tools and host toolchain.  Summary of changes:

* Rewrite src/tools Make logic to work like the rest of the tree wrt
  "dependall" and "install".  The old "make build" hack is gone.

* Remove the MKTOOLS logic.  This was linked to the "make build" hack,
  and was only needed because TOOLDIR originally had no writable default.

* Redo the GNU configure/make logic to make it fit reasonably in a
  BSD make wrapper.  Use new ${.ALLTARGETS} variable to scan for
  targets in $(srcdir), and mark them with .MADE: to prevent rebuilding.

* Only build cross tools in src/tools; remove some messy logic in
  src/usr.* and src/gnu/usr.* that would do target filename rewriting
  (improves consistency and readability).

* Add the ability to build cross gdb at tool build time by setting
  MKCROSSGDB (default no) to "yes" in mk.conf.

* Add src/tools/groff and set up paths to work with this cross groff.

diffstat:

 BUILDING                          |  19 +-------
 BUILDING.mdoc                     |  25 +---------
 Makefile                          |  39 ++++++++-------
 build.sh                          |   6 +-
 gnu/usr.sbin/dbsym/Makefile       |  68 +++++++--------------------
 gnu/usr.sbin/mdsetimage/Makefile  |  68 +++++++--------------------
 lib/libasn1/asn1_compile/Makefile |  27 ++++-------
 share/mk/bsd.doc.mk               |   5 +-
 share/mk/bsd.man.mk               |  13 +++-
 share/mk/bsd.own.mk               |  20 +++-----
 share/mk/bsd.sys.mk               |   3 +-
 tools/Makefile                    |  34 ++++++++++---
 tools/Makefile.gnuhost            |  93 +++++++++++++++++++++++++++++++++++++++
 tools/Makefile.gnuwrap            |  14 +++++
 tools/Makefile.host               |  76 +++++++++++++++++--------------
 tools/Makefile.inc                |  32 +------------
 tools/asn1_compile/Makefile       |  12 +----
 tools/binstall/Makefile           |   6 +-
 tools/compile_et/Makefile         |   4 +-
 tools/config/Makefile             |   4 +-
 tools/crunchgen/Makefile          |   4 +-
 tools/dbsym/Makefile              |  17 ++----
 tools/gencat/Makefile             |   4 +-
 tools/groff/Makefile              |  28 +++++++++++
 tools/lex/Makefile                |   4 +-
 tools/lint/Makefile               |  15 +----
 tools/lint/Makefile.inc           |  15 ------
 tools/lint1/Makefile              |  10 +---
 tools/lint2/Makefile              |  10 +---
 tools/mdsetimage/Makefile         |  17 ++----
 tools/menuc/Makefile              |   8 +--
 tools/mkdep/Makefile              |  11 +++-
 tools/mklocale/Makefile           |   4 +-
 tools/msgc/Makefile               |   8 +--
 tools/mtree/Makefile              |   6 +-
 tools/rpcgen/Makefile             |   4 +-
 tools/texinfo/Makefile            |  50 +-------------------
 tools/toolchain/Makefile          |  81 +++++++--------------------------
 tools/toolchain/stub.sh           |   5 --
 tools/tsort/Makefile              |   4 +-
 tools/yacc/Makefile               |   4 +-
 usr.bin/xlint/Makefile.inc        |   6 +-
 usr.bin/xlint/lint1/Makefile      |  41 +++++++----------
 usr.bin/xlint/lint2/Makefile      |  21 +++-----
 usr.bin/xlint/xlint/Makefile      |  27 ++--------
 45 files changed, 404 insertions(+), 568 deletions(-)

diffs (truncated from 1577 to 300 lines):

diff -r 2c7dc5170bf0 -r 711c709a2e2f BUILDING
--- a/BUILDING  Mon Nov 12 23:08:56 2001 +0000
+++ b/BUILDING  Mon Nov 12 23:16:17 2001 +0000
@@ -239,23 +239,6 @@
 
                     Default: ``yes''
 
-     MKTOOLS        Indicates whether the host tools will be built and in-
-                    stalled automatically if they are out-of-date.
-
-                    yes    Build tools as needed into TOOLDIR, but only if the
-                           tools in question are out-of-date.
-
-                    no     Do not update the tools in TOOLDIR; halt the build
-                           as a safety precaution if tools are out-of-date.
-
-                    always
-                           Always rebuild the tools in TOOLDIR from scratch
-                           during a build.  This is similar to the standard
-                           NetBSD source tree build method, but is not typi-
-                           cally required for host tools.
-
-                    Default: ``yes''
-
      NBUILDJOBS     If set, specifies the number of parallel make(1) processes
                     that should be run simultaneously.  This can speed up
                     builds on SMP machines, or machines with much more CPU
@@ -468,4 +451,4 @@
 BUGS
      Many platforms are not yet using the USE_NEW_TOOLCHAIN system.
 
-NetBSD                         October 29, 2001                              8
+NetBSD                         November 12, 2001                             7
diff -r 2c7dc5170bf0 -r 711c709a2e2f BUILDING.mdoc
--- a/BUILDING.mdoc     Mon Nov 12 23:08:56 2001 +0000
+++ b/BUILDING.mdoc     Mon Nov 12 23:16:17 2001 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: BUILDING.mdoc,v 1.8 2001/11/08 21:29:06 wiz Exp $
+.\"    $NetBSD: BUILDING.mdoc,v 1.9 2001/11/12 23:16:18 tv Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -38,7 +38,7 @@
 .\" NOTE: After changing this file, run "make build-docs" to generate the
 .\" proper plaintext versions, and check in all BUILDING.* files!
 .\"
-.Dd October 29, 2001
+.Dd November 12, 2001
 .Dt BUILDING 8
 .Os NetBSD
 .
@@ -430,27 +430,6 @@
 pass) at the start of a build.
 .DFLTy
 .
-.It Sy MKTOOLS
-Indicates whether the host tools will be built and installed
-automatically if they are out-of-date.
-.Bl -tag -width "never"
-.It Sy yes
-Build tools as needed into
-.Sy TOOLDIR ,
-but only if the tools in question are out-of-date.
-.It Sy no
-Do not update the tools in
-.Sy TOOLDIR ;
-halt the build as a safety precaution if tools are out-of-date.
-.It Sy always
-Always rebuild the tools in
-.Sy TOOLDIR
-from scratch during a build.  This is similar to the standard
-.Nx
-source tree build method, but is not typically required for host tools.
-.El
-.DFLTy
-.
 .It Sy NBUILDJOBS
 If set, specifies the number of parallel
 .Xr make 1
diff -r 2c7dc5170bf0 -r 711c709a2e2f Makefile
--- a/Makefile  Mon Nov 12 23:08:56 2001 +0000
+++ b/Makefile  Mon Nov 12 23:16:17 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.151 2001/11/11 22:40:42 tv Exp $
+#      $NetBSD: Makefile,v 1.152 2001/11/12 23:16:17 tv Exp $
 
 # This is the top-level makefile for building NetBSD. For an outline of
 # how to build a snapshot or release, as well as other release engineering
@@ -46,7 +46,7 @@
 # Targets invoked by `make build,' in order:
 #   obj:             creates object directories.
 #   cleandir:        cleans the tree.
-#   do-make-tools:   builds host toolchain.
+#   do-tools:        builds host toolchain.
 #   do-distrib-dirs: creates the distribution directories.
 #   includes:        installs include files.
 #   do-lib-csu:      builds and installs prerequisites from lib/csu.
@@ -91,13 +91,13 @@
 .if exists(regress)
 regression-tests:
        @echo Running regression tests...
-       @cd ${.CURDIR}/regress && ${MAKE} regress
+       @(cd ${.CURDIR}/regress && ${MAKE} regress)
 .endif
 
 .if ${MKMAN} != "no"
 afterinstall: whatis.db
 whatis.db:
-       cd ${.CURDIR}/share/man && ${MAKE} makedb
+       (cd ${.CURDIR}/share/man && ${MAKE} makedb)
 .endif
 
 # Targets (in order!) called by "make build".
@@ -109,7 +109,7 @@
 BUILDTARGETS+= cleandir
 .endif
 .if ${USETOOLS} == "yes"
-BUILDTARGETS+= do-make-tools
+BUILDTARGETS+= do-tools
 .endif
 .if !defined(NODISTRIBDIRS)
 BUILDTARGETS+= do-distrib-dirs
@@ -141,25 +141,21 @@
 # Build a release or snapshot (implies "make build").
 
 release snapshot: build
-       cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release
+       (cd ${.CURDIR}/etc && ${MAKE} INSTALL_DONE=1 release)
 
 # Special components of the "make build" process.
 
-do-make-tools:
-       cd ${.CURDIR}/tools && ${MAKE} build
-
 do-distrib-dirs:
 .if !defined(DESTDIR) || ${DESTDIR} == ""
-       cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs
+       (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
 .else
-       cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs
+       (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=${DESTDIR} distrib-dirs)
 .endif
 
-.for dir in lib/csu lib gnu/lib
+.for dir in tools lib/csu lib gnu/lib
 do-${dir:S/\//-/}:
 .for targ in dependall install
-       cd ${.CURDIR}/${dir} && \
-               ${MAKE} ${_J} MKSHARE=no MKLINT=no ${targ}
+       (cd ${.CURDIR}/${dir} && ${MAKE} ${_J} MKSHARE=no MKLINT=no ${targ})
 .endfor
 .endfor
 
@@ -170,10 +166,17 @@
 # Speedup stubs for some subtrees that don't need to run these rules.
 # (Tells <bsd.subdir.mk> not to recurse for them.)
 
-includes-bin includes-games includes-libexec includes-regress \
-includes-sbin includes-usr.sbin includes-tools \
-dependall-tools depend-tools all-tools install-tools install-regress \
-dependall-distrib depend-distrib all-distrib install-distrib includes-distrib:
+.for dir in bin etc distrib games libexec regress sbin usr.sbin tools
+includes-${dir}:
+       @true
+.endfor
+.for dir in etc distrib regress
+install-${dir}:
+       @true
+.endfor
+
+# XXX this needs to change when distrib Makefiles are recursion compliant
+dependall-distrib depend-distrib all-distrib:
        @true
 
 .include <bsd.obj.mk>
diff -r 2c7dc5170bf0 -r 711c709a2e2f build.sh
--- a/build.sh  Mon Nov 12 23:08:56 2001 +0000
+++ b/build.sh  Mon Nov 12 23:16:17 2001 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-#  $NetBSD: build.sh,v 1.22 2001/11/12 08:54:58 msaitoh Exp $
+#  $NetBSD: build.sh,v 1.23 2001/11/12 23:16:17 tv Exp $
 #
 # Top level build wrapper, for a system containing no tools.
 #
@@ -308,7 +308,7 @@
 eval cat <<EOF $makewrapout
 #! /bin/sh
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.22 2001/11/12 08:54:58 msaitoh Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.23 2001/11/12 23:16:17 tv Exp $
 #
 
 EOF
@@ -331,5 +331,5 @@
                $runcmd $makewrapper obj-tools || exit 1
        fi
        $runcmd cd tools
-       ${runcmd-exec} $makewrapper MKTOOLS=always build
+       ${runcmd-exec} $makewrapper dependall install
 fi
diff -r 2c7dc5170bf0 -r 711c709a2e2f gnu/usr.sbin/dbsym/Makefile
--- a/gnu/usr.sbin/dbsym/Makefile       Mon Nov 12 23:08:56 2001 +0000
+++ b/gnu/usr.sbin/dbsym/Makefile       Mon Nov 12 23:16:17 2001 +0000
@@ -1,67 +1,35 @@
-#      $NetBSD: Makefile,v 1.1 2001/11/09 05:52:20 thorpej Exp $
-
-PROG=  dbsym
+#      $NetBSD: Makefile,v 1.2 2001/11/12 23:16:19 tv Exp $
 
-.if defined(DBSYM_TARGET_PREFIX)
-PROGNAME= ${DBSYM_TARGET_PREFIX}${PROG}
-NAM=   ${DBSYM_TARGET_PREFIX}dbsym.8
-.else
-MAN=   dbsym.8
-.endif
+.include <bsd.own.mk>
 
-.if defined(DBSYM_TARGET_PREFIX)
-${DBSYM_TARGET_PREFIX}dbsym.8: ${.CURDIR}/dbsym.8
-       cp ${.IMPSRC} ${.TARGET}
-.endif
-
-.ifdef HOSTPROG
-# BFDDIR and IBERTYDIR must already be set
+.if defined(USE_NEW_TOOLCHAIN)
 TOP=           ${.CURDIR}/../..
 DIST=          ${TOP}/dist/toolchain
 
-# Host tool Makefile MUST set HOST_CPPFLAGS!
-#CPPFLAGS+=    -I${BFDDIR} -I${DIST}/include
+PROG=          dbsym
+MAN=           dbsym.8
 
-DPADD+=        ${BFDDIR}/libbfd.a
-LDADD+=        -L${BFDDIR} -lbfd
+CPPFLAGS+=     -I${BFDDIR} -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include \
+               -DHAVE_CONFIG_H 
 
-DPADD+=        ${IBERTYDIR}/libiberty.a
-LDADD+=        -L${IBERTYDIR} -liberty
-.else
-# XXX in an ideal world...
-# LDADD+= -lbfd
-# DPADD+= ${LIBBFD}
+DPADD+=                ${BFDDIR}/libbfd.a
+LDADD+=                -L${BFDDIR} -lbfd
 
-.include <bsd.own.mk>
-.ifdef USE_NEW_TOOLCHAIN
-TOP=           ${.CURDIR}/../..
-DIST=          ${TOP}/dist/toolchain
+DPADD+=                ${IBERTYDIR}/libiberty.a
+LDADD+=                -L${IBERTYDIR} -liberty
 
+.ifndef HOSTPROG
 .include       "${TOP}/lib/libbfd/arch/${MACHINE_ARCH}/defs.mk"
 
-CPPFLAGS+=     -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} \
-               -I${BFDOBJ} ${G_INCLUDES}
+BFDDIR!=       cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR}
+IBERTYDIR!=    cd ${TOP}/lib/libiberty && ${PRINTOBJDIR}
 
-BFDOBJ!=       cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR}
-DPADD+=                ${BFDOBJ}/libbfd_pic.a
-LDADD+=                -L${BFDOBJ} -lbfd
-
-IBERTYOBJ!=    cd ${TOP}/lib/libiberty && ${PRINTOBJDIR}
-LDADD+=                -L${IBERTYOBJ} -liberty
-DPADD+=                ${IBERTYOBJ}/libiberty.a
-
+CPPFLAGS+=     -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} ${G_INCLUDES}
 LDADD+=                -lintl
 DPADD+=                ${LIBINTL}
-.else # !USE_NEW_TOOLCHAIN
-DIST=          ${.CURDIR}/../../dist
-BFDOBJ!=       cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR}
+.endif # HOSTPROG
+.endif # USE_NEW_TOOLCHAIN
 
-CPPFLAGS+=     -I${BFDOBJ} -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include \
-               -DHAVE_CONFIG_H 
-
-DPADD+=                ${BFDOBJ}/libbfd_pic.a
-LDADD+=                -L${BFDOBJ} -lbfd
-.endif # !USE_NEW_TOOLCHAIN
-
+.ifndef HOSTPROG
 .include <bsd.prog.mk>
 .endif # HOSTPROG
diff -r 2c7dc5170bf0 -r 711c709a2e2f gnu/usr.sbin/mdsetimage/Makefile
--- a/gnu/usr.sbin/mdsetimage/Makefile  Mon Nov 12 23:08:56 2001 +0000
+++ b/gnu/usr.sbin/mdsetimage/Makefile  Mon Nov 12 23:16:17 2001 +0000
@@ -1,67 +1,35 @@
-#      $NetBSD: Makefile,v 1.4 2001/10/25 02:37:18 thorpej Exp $
-
-PROG=  mdsetimage
+#      $NetBSD: Makefile,v 1.5 2001/11/12 23:16:19 tv Exp $
 
-.if defined(MDSETIMAGE_TARGET_PREFIX)



Home | Main Index | Thread Index | Old Index