diff --git a/BUILDING b/BUILDING index 9a4ebb00738c..a26d91ae0c7d 100644 --- a/BUILDING +++ b/BUILDING @@ -239,23 +239,6 @@ CONFIGURATION 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 @@ HISTORY BUGS Many platforms are not yet using the USE_NEW_TOOLCHAIN system. -NetBSD October 29, 2001 8 +NetBSD November 12, 2001 7 diff --git a/BUILDING.mdoc b/BUILDING.mdoc index 2f670d2d3ac5..9b49a60d5530 100644 --- a/BUILDING.mdoc +++ b/BUILDING.mdoc @@ -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 @@ Indicates whether object directories will be created automatically 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 --git a/Makefile b/Makefile index 61b976e9ae15..944e408b42b7 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ SUBDIR+= ${dir} .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+= obj 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: # 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 @@ do-build: # Speedup stubs for some subtrees that don't need to run these rules. # (Tells 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 diff --git a/build.sh b/build.sh index 7eddf66b1052..c5e5a411f11d 100755 --- a/build.sh +++ b/build.sh @@ -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 @@ fi eval cat < -.ifdef USE_NEW_TOOLCHAIN + +.if defined(USE_NEW_TOOLCHAIN) TOP= ${.CURDIR}/../.. DIST= ${TOP}/dist/toolchain -.include "${TOP}/lib/libbfd/arch/${MACHINE_ARCH}/defs.mk" +PROG= dbsym +MAN= dbsym.8 -CPPFLAGS+= -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} \ - -I${BFDOBJ} ${G_INCLUDES} - -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 - -LDADD+= -lintl -DPADD+= ${LIBINTL} -.else # !USE_NEW_TOOLCHAIN -DIST= ${.CURDIR}/../../dist -BFDOBJ!= cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR} - -CPPFLAGS+= -I${BFDOBJ} -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include \ +CPPFLAGS+= -I${BFDDIR} -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 +DPADD+= ${BFDDIR}/libbfd.a +LDADD+= -L${BFDDIR} -lbfd +DPADD+= ${IBERTYDIR}/libiberty.a +LDADD+= -L${IBERTYDIR} -liberty + +.ifndef HOSTPROG +.include "${TOP}/lib/libbfd/arch/${MACHINE_ARCH}/defs.mk" + +BFDDIR!= cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR} +IBERTYDIR!= cd ${TOP}/lib/libiberty && ${PRINTOBJDIR} + +CPPFLAGS+= -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} ${G_INCLUDES} +LDADD+= -lintl +DPADD+= ${LIBINTL} +.endif # HOSTPROG +.endif # USE_NEW_TOOLCHAIN + +.ifndef HOSTPROG .include .endif # HOSTPROG diff --git a/gnu/usr.sbin/mdsetimage/Makefile b/gnu/usr.sbin/mdsetimage/Makefile index a2e7650b40ed..a2a73f81230b 100644 --- a/gnu/usr.sbin/mdsetimage/Makefile +++ b/gnu/usr.sbin/mdsetimage/Makefile @@ -1,67 +1,35 @@ -# $NetBSD: Makefile,v 1.4 2001/10/25 02:37:18 thorpej Exp $ - -PROG= mdsetimage - -.if defined(MDSETIMAGE_TARGET_PREFIX) -PROGNAME= ${MDSETIMAGE_TARGET_PREFIX}${PROG} -MAN= ${MDSETIMAGE_TARGET_PREFIX}mdsetimage.8 -.else -MAN= mdsetimage.8 -.endif - -.if defined(MDSETIMAGE_TARGET_PREFIX) -${MDSETIMAGE_TARGET_PREFIX}mdsetimage.8: ${.CURDIR}/mdsetimage.8 - cp ${.IMPSRC} ${.TARGET} -.endif - -.ifdef HOSTPROG -# BFDDIR and IBERTYDIR must already be set -TOP= ${.CURDIR}/../.. -DIST= ${TOP}/dist/toolchain - -# Host tool Makefile MUST set HOST_CPPFLAGS! -#CPPFLAGS+= -I${BFDDIR} -I${DIST}/include - -DPADD+= ${BFDDIR}/libbfd.a -LDADD+= -L${BFDDIR} -lbfd - -DPADD+= ${IBERTYDIR}/libiberty.a -LDADD+= -L${IBERTYDIR} -liberty -.else -# XXX in an ideal world... -# LDADD+= -lbfd -# DPADD+= ${LIBBFD} +# $NetBSD: Makefile,v 1.5 2001/11/12 23:16:19 tv Exp $ .include -.ifdef USE_NEW_TOOLCHAIN + +.if defined(USE_NEW_TOOLCHAIN) TOP= ${.CURDIR}/../.. DIST= ${TOP}/dist/toolchain -.include "${TOP}/lib/libbfd/arch/${MACHINE_ARCH}/defs.mk" +PROG= mdsetimage +MAN= mdsetimage.8 -CPPFLAGS+= -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} \ - -I${BFDOBJ} ${G_INCLUDES} - -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 - -LDADD+= -lintl -DPADD+= ${LIBINTL} -.else # !USE_NEW_TOOLCHAIN -DIST= ${.CURDIR}/../../dist -BFDOBJ!= cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR} - -CPPFLAGS+= -I${BFDOBJ} -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include \ +CPPFLAGS+= -I${BFDDIR} -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 +DPADD+= ${BFDDIR}/libbfd.a +LDADD+= -L${BFDDIR} -lbfd +DPADD+= ${IBERTYDIR}/libiberty.a +LDADD+= -L${IBERTYDIR} -liberty + +.ifndef HOSTPROG +.include "${TOP}/lib/libbfd/arch/${MACHINE_ARCH}/defs.mk" + +BFDDIR!= cd ${.CURDIR}/../../lib/libbfd && ${PRINTOBJDIR} +IBERTYDIR!= cd ${TOP}/lib/libiberty && ${PRINTOBJDIR} + +CPPFLAGS+= -I${TOP}/lib/libbfd/arch/${MACHINE_ARCH} ${G_INCLUDES} +LDADD+= -lintl +DPADD+= ${LIBINTL} +.endif # HOSTPROG +.endif # USE_NEW_TOOLCHAIN + +.ifndef HOSTPROG .include .endif # HOSTPROG diff --git a/lib/libasn1/asn1_compile/Makefile b/lib/libasn1/asn1_compile/Makefile index b15cfdb74e8b..1a938525b900 100644 --- a/lib/libasn1/asn1_compile/Makefile +++ b/lib/libasn1/asn1_compile/Makefile @@ -1,22 +1,13 @@ -# $NetBSD: Makefile,v 1.11 2001/10/25 07:42:39 thorpej Exp $ - -NOMAN= noman - -.include +# $NetBSD: Makefile,v 1.12 2001/11/12 23:16:20 tv Exp $ DIST= ${.CURDIR}/../../../crypto/dist .PATH: ${DIST}/heimdal/lib/asn1 ${DIST}/heimdal/lib/roken ${DIST}/heimdal/lib/vers -WARNS?= 1 -MKLINT= no +PROG= asn1_compile -.ifdef HOSTPROG -# This is is what src/tools/Makefile.host expects -PROG= asn1_compile -XXX_CROSS_TOOL=yes # temporary hack -.else -HOSTPROG= asn1_compile -.endif +MKLINT= no +MKMAN= no +WARNS?= 1 asn1_compile_SRCS = \ gen.c \ @@ -42,7 +33,7 @@ roken_SRCS = \ SRCS= $(asn1_compile_SRCS) \ $(roken_SRCS) -YHEADER= 1 +YHEADER= #LIBROKEN!= cd ${.CURDIR}/../../libroken && ${PRINTOBJDIR} # -I${LIBROKEN} \ @@ -53,8 +44,7 @@ HOST_CPPFLAGS+= -I. \ -I${DIST}/heimdal/lib/roken \ -DHAVE_CONFIG_H -.ifndef XXX_CROSS_TOOL -DPSRCS= print_version.h +DPSRCS= print_version.h make-print-version.lo: ${.CURDIR}/../../../include/heimdal/version.h @@ -66,5 +56,8 @@ print_version.h: make-print-version CLEANFILES+= print_version.h make-print-version make-print-version.lo +# HOSTPROG will be set already if this is a src/tools build. +.ifndef HOSTPROG +HOSTPROG= ${PROG} .include .endif diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk index 132787fcfa36..91aa892929eb 100644 --- a/share/mk/bsd.doc.mk +++ b/share/mk/bsd.doc.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.doc.mk,v 1.53 2001/11/02 05:21:50 tv Exp $ +# $NetBSD: bsd.doc.mk,v 1.54 2001/11/12 23:16:20 tv Exp $ # @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93 .include @@ -9,14 +9,13 @@ clean: cleandoc realinstall: docinstall ##### Default values -BIB?= bib EQN?= eqn GREMLIN?= grn GRIND?= vgrind -f INDXBIB?= indxbib PIC?= pic REFER?= refer -ROFF?= groff -Tps +ROFF?= ${GROFF} -Tps SOELIM?= soelim TBL?= tbl diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 42d09d03e142..f2cc0f812a60 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.man.mk,v 1.65 2001/11/04 00:30:52 enami Exp $ +# $NetBSD: bsd.man.mk,v 1.66 2001/11/12 23:16:20 tv Exp $ # @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93 .include @@ -9,7 +9,12 @@ realinstall: ${MANINSTALL} ##### Default values +.if ${USETOOLS} == "yes" +TMACDIR?= ${TOOLDIR}/share/groff/tmac +.else TMACDIR?= ${DESTDIR}/usr/share/tmac +.endif + HTMLDIR?= ${DESTDIR}/usr/share/man CATDEPS?= ${TMACDIR}/tmac.andoc \ ${TMACDIR}/tmac.doc \ @@ -18,9 +23,9 @@ CATDEPS?= ${TMACDIR}/tmac.andoc \ ${TMACDIR}/tmac.doc-nroff \ ${TMACDIR}/tmac.doc-syms MANTARGET?= cat -NROFF?= nroff -Tascii -GROFF?= groff -Tascii -GROFF_HTML?= groff -Tlatin1 -mdoc2html -P-b -P-o -P-u + +GROFF_HTML?= ${GROFF} -Tlatin1 -mdoc2html -P-b -P-o -P-u +NROFF?= ${GROFF} -Tascii -mtty-char TBL?= tbl MAN?= diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index b99f6c76d276..33791d6ff408 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.213 2001/11/12 20:11:21 tv Exp $ +# $NetBSD: bsd.own.mk,v 1.214 2001/11/12 23:16:21 tv Exp $ .if !defined(_BSD_OWN_MK_) _BSD_OWN_MK_=1 @@ -77,7 +77,6 @@ TOOLDIR:= ${_TOOLOBJ}/tools.${HOST_OSTYPE} AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as ASN1_COMPILE= ${TOOLDIR}/bin/asn1_compile -#BIB= ${TOOLDIR}/bin/bib CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc COMPILE_ET= ${TOOLDIR}/bin/compile_et CONFIG= ${TOOLDIR}/bin/config @@ -85,19 +84,18 @@ CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp CRUNCHGEN= MAKE=${.MAKE} ${TOOLDIR}/bin/crunchgen CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++ DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym -#EQN= ${TOOLDIR}/bin/eqn +EQN= ${TOOLDIR}/bin/eqn FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77 GENCAT= ${TOOLDIR}/bin/gencat #GRIND= ${TOOLDIR}/bin/vgrind -f -#GROFF= ${TOOLDIR}/bin/groff -Tascii -#INDXBIB= ${TOOLDIR}/bin/indxbib +GROFF= ${TOOLDIR}/bin/groff +INDXBIB= ${TOOLDIR}/bin/indxbib INSTALL= STRIP=${STRIP} ${TOOLDIR}/bin/binstall INSTALL_INFO= ${TOOLDIR}/bin/install-info LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld LEX= ${TOOLDIR}/bin/lex LINT= CC="${CC}" ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint LORDER= NM="${NM}" ${TOOLDIR}/bin/lorder -#MAKE= ${TOOLDIR}/bin/bmake MAKEINFO= ${TOOLDIR}/bin/makeinfo MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/menuc @@ -106,18 +104,16 @@ MKLOCALE= ${TOOLDIR}/bin/mklocale MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/msgc MTREE= ${TOOLDIR}/bin/mtree NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm -#NROFF= ${TOOLDIR}/bin/nroff -Tascii OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy -#PIC= ${TOOLDIR}/bin/pic +PIC= ${TOOLDIR}/bin/pic RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib -#REFER= ${TOOLDIR}/bin/refer -#ROFF= ${TOOLDIR}/bin/groff -Tps +REFER= ${TOOLDIR}/bin/refer RPCGEN= ${TOOLDIR}/bin/rpcgen SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size -#SOELIM= ${TOOLDIR}/bin/soelim +SOELIM= ${TOOLDIR}/bin/soelim STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip -#TBL= ${TOOLDIR}/bin/tbl +TBL= ${TOOLDIR}/bin/tbl TSORT= ${TOOLDIR}/bin/tsort -q YACC= ${TOOLDIR}/bin/yacc diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index a68827a188a8..6913604706c9 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.58 2001/11/11 21:41:00 tv Exp $ +# $NetBSD: bsd.sys.mk,v 1.59 2001/11/12 23:16:21 tv Exp $ # # Build definitions used for NetBSD source tree builds. @@ -53,6 +53,7 @@ HOST_LDFLAGS?= CONFIG?= config CRUNCHGEN?= crunchgen +GROFF?= groff OBJCOPY?= objcopy RPCGEN?= rpcgen STRIP?= strip diff --git a/tools/Makefile b/tools/Makefile index c05fcf963bac..06e94ff9c533 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,19 +1,37 @@ -# $NetBSD: Makefile,v 1.15 2001/11/09 15:07:25 thorpej Exp $ +# $NetBSD: Makefile,v 1.16 2001/11/12 23:16:22 tv Exp $ .include +# Dependencies in SUBDIR below ordered to maximize parallel ability. .if !defined(NOSUBDIR) -SUBDIR= binstall .WAIT gencat mkdep mtree rpcgen tsort \ - yacc .WAIT lex .WAIT \ - asn1_compile compile_et config lint lint1 lint2 lorder \ - toolchain .WAIT texinfo crunchgen msgc menuc mklocale \ - mdsetimage dbsym +SUBDIR= mkdep .WAIT \ + binstall .WAIT \ + crunchgen gencat lint lint2 lorder mtree rpcgen \ + texinfo tsort \ + toolchain .WAIT \ + dbsym mdsetimage \ + yacc .WAIT \ + groff \ + lex .WAIT \ + asn1_compile compile_et config lint1 msgc menuc mklocale .endif -TARGETS+= build - .include .include +# For each .WAIT point, make sure the previous target is installed before +# building a dependent target. +_dep:= +_last:= +.for d in ${SUBDIR} +_this:= ${d} +.if ${_this} == ".WAIT" +_dep:= ${_dep} install-${_last} +.else +_last:= ${d} +depend-${d} all-${d} dependall-${d}: ${_dep} +.endif +.endfor + cleantools: rm -r -f tools.${HOST_OSTYPE} diff --git a/tools/Makefile.gnuhost b/tools/Makefile.gnuhost new file mode 100644 index 000000000000..c26d8f9bd048 --- /dev/null +++ b/tools/Makefile.gnuhost @@ -0,0 +1,93 @@ +# $NetBSD: Makefile.gnuhost,v 1.1 2001/11/12 23:16:23 tv Exp $ +# +# Rules used when building a GNU host package. Expects MODULE to be set. +# +# There's not a lot we can do to build reliably in the face of many +# available configuration options. To be as low-overhead as possible, +# we follow the following scheme: +# +# * Configuration is only re-run when an autoconf source file (such as +# "configure" or "config.sub") is changed. +# +# * "config.status" is run to rebuild Makefiles and .h files if an +# autoconf-parsed file (such as Makefile.in) is changed. +# +# * If UPDATE is set, "make install" is only run if a build has happened +# since the last install in the current directory. + +.include + +.MAKEFLAGS: -j1 + +DIST= ${.CURDIR}/../../gnu/dist/${MODULE} +WRAPPER:= ${.PARSEDIR}/Makefile.gnuwrap + +FIND_ARGS+= \! \( -type d \( \ + -name 'CVS' -o \ + -name 'config' -o \ + -name 'doc' -o \ + -name 'po' -o \ + -name 'tests*' \ + \) -prune \) + +# Do this "find" only if actually building something. +.if (${USETOOLS} == "yes") && empty(.MAKEFLAGS:M-V*) && \ + (make(all) || make(realall) || (!make(clean) && !make(cleandir) && !make(obj))) && \ + !defined(_GNU_CFGSRC) + +_GNU_CFGSRC!= find ${DIST} ${FIND_ARGS} \ + -type f \( -name 'config*' -o -name '*.in' \) -print +.MAKEOVERRIDES+= _GNU_CFGSRC +.endif + +CONFIGURE_ENV+= CC=${HOST_CC:Q} \ + CFLAGS=${HOST_CFLAGS:Q} \ + CPPFLAGS=${HOST_CPPFLAGS:Q} \ + CXX=${HOST_CXX:Q} \ + CXXFLAGS=${HOST_CXXFLAGS:Q} \ + INSTALL=${INSTALL:Q} \ + LDFLAGS=${HOST_LDFLAGS:Q} \ + PATH="${TOOLDIR}/bin:$$PATH" + +CONFIGURE_ARGS+=--prefix=${TOOLDIR} --disable-shared + +MAKE_ARGS+= LEX=true BISON=true DESTDIR= INSTALL="${INSTALL_FILE}" + +ALL_TARGET?= all +INSTALL_TARGET?=install + +.configure_done: ${_GNU_CFGSRC} + @mkdir build 2>/dev/null || true + @echo ${?:T} + @(cd build && ${CONFIGURE_ENV} ${DIST}/configure ${CONFIGURE_ARGS}) + @touch $@ + +.build_done: .configure_done + @(cd build && ${MAKE} -f ${WRAPPER} ${ALL_TARGET}) + @touch $@ + +.install_done: +.if defined(UPDATE) + @if [ ! -f .install_done ] || [ .build_done -nt .install_done ]; then \ + (cd build && ${MAKE} -f ${WRAPPER} ${MAKE_ARGS} ${INSTALL_TARGET}); \ + fi +.else + @(cd build && ${MAKE} -f ${WRAPPER} ${MAKE_ARGS} ${INSTALL_TARGET}) +.endif + @touch $@ + +.PHONY: .build_done .install_done +.ORDER: .build_done .install_done + +# Mapping to standard targets. + +.if ${USETOOLS} == "yes" +realall: .build_done +realinstall: .install_done +.endif + +clean: clean.gnu +clean.gnu: + -rm -r -f .*_done build + +.include diff --git a/tools/Makefile.gnuwrap b/tools/Makefile.gnuwrap new file mode 100644 index 000000000000..ad4456e5abfb --- /dev/null +++ b/tools/Makefile.gnuwrap @@ -0,0 +1,14 @@ +# $NetBSD: Makefile.gnuwrap,v 1.1 2001/11/12 23:16:23 tv Exp $ +# +# Wrapper for GNU Makefiles. + +.include "${.CURDIR}/Makefile" + +# Prevent targets in source directories from being rebuilt. + +_srcdir:= ${srcdir} +.MADE: ${.ALLTARGETS:M${srcdir}/*} + +# Don't rebuild .gmo files, or lex/yacc (which GNU puts in the source tree). +.po.gmo .l.c .y.c .y.h: + @true diff --git a/tools/Makefile.host b/tools/Makefile.host index dc5bdcf548f5..9b815b4fa55b 100644 --- a/tools/Makefile.host +++ b/tools/Makefile.host @@ -1,59 +1,67 @@ -# $NetBSD: Makefile.host,v 1.9 2001/11/12 17:46:35 tv Exp $ +# $NetBSD: Makefile.host,v 1.10 2001/11/12 23:16:24 tv Exp $ -# Preload to set up obj rules (with proper ${.CURDIR}). -OBJHOSTMACHINE= # set -.include +.include -# We might need the PRINTOBJDIR variable -- make sure it's defined. -# XXX It really sucks to have to copy this from . -PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f- +# Resolve pathnames in variables. +_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD HOST_CPPFLAGS LDADD +.for var in ${_RESOLVE_VARS} +${var}:= ${${var}} +.endfor -# Save value of .CURDIR, and reassign it to the "real" source directory. +# Switch over to the "real" Makefile. +.PROGDIR:= ${.CURDIR}/../../${HOST_SRCDIR} _CURDIR:= ${.CURDIR} -.CURDIR:= ${_CURDIR}/../../${HOST_SRCDIR} - -# Set HOSTPROG as a flag to the real program not to include . HOSTPROG?= ${PROG} -# Pull in the "real" Makefile. +.CURDIR:= ${.PROGDIR} +.PATH: ${.CURDIR} .include "${.CURDIR}/Makefile" -.if exists(${.CURDIR}/../Makefile.inc) -.include "${.CURDIR}/../Makefile.inc" -.endif +.-include "${.CURDIR}/../Makefile.inc" + +# Resolve pathnames from "real" Makefile, and switch .CURDIR back. +.for var in ${_RESOLVE_VARS} +${var}:= ${${var}} +.endfor +.CURDIR:= ${_CURDIR} +.undef _CURDIR # Set up the environment for . +.if ${USETOOLS} != "yes" +.undef HOSTPROG +.endif + HOSTPROGNAME?= ${HOSTPROG} HOST_BINDIR?= ${TOOLDIR}/bin -HOST_CPPFLAGS:= -include ${_CURDIR}/../compat/compat_netbsd.h -Wall \ +HOST_CPPFLAGS:= -include ${.CURDIR}/../compat/compat_netbsd.h -Wall \ ${HOST_CPPFLAGS} ${CPPFLAGS} MKMAN= no SRCS?= ${PROG}.c SRCS+= ${HOST_SRCS} nb_progname.c -TIMESTAMP?= ${HOST_BINDIR}/${HOSTPROGNAME} .undef LINKS -.PATH: ${.CURDIR} ${_CURDIR}/../compat -${TIMESTAMP}: ${.CURDIR}/Makefile - -# Include the local definitions, and then . -.include "${_CURDIR}/../Makefile.inc" -.include +.PATH: ${.PROGDIR} ${.CURDIR}/../compat # Install rule. realinstall: install.host install.files -install.host: +install.host: ${HOST_BINDIR}/${HOSTPROGNAME} +${HOST_BINDIR}/${HOSTPROGNAME}:: ${HOSTPROG} mkdir -p ${HOST_BINDIR} - ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${BINMODE} \ - ${HOSTPROG} ${HOST_BINDIR}/${HOSTPROGNAME} + ${INSTALL_FILE:N-U} -m ${BINMODE} ${.ALLSRC} ${.TARGET} -.if defined(HOSTFILES) -install.files: - mkdir -p ${HOST_FILESDIR} - for i in ${HOSTFILES}; \ - do \ - ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${NONBINMODE} \ - ${.CURDIR}/$$i ${HOST_FILESDIR}/$$i; \ - done -.else -install.files: +.if !defined(UPDATE) +.PHONY: ${HOST_BINDIR}/${HOSTPROGNAME} .endif + +install.files: +.for F in ${HOSTFILES} +install.files: ${HOST_FILESDIR}/${F} +${HOST_FILESDIR}/${F}: ${F} + mkdir -p ${HOST_FILESDIR} + ${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} + +.if !defined(UPDATE) +.PHONY: ${HOST_FILESDIR}/${F} +.endif +.endfor + +.include diff --git a/tools/Makefile.inc b/tools/Makefile.inc index cf9185b74fdd..da2bb7aaf2e8 100644 --- a/tools/Makefile.inc +++ b/tools/Makefile.inc @@ -1,33 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.11 2001/10/31 17:46:08 tv Exp $ +# $NetBSD: Makefile.inc,v 1.12 2001/11/12 23:16:24 tv Exp $ .include -.if ${USETOOLS} != "yes" -.undef HOSTPROG -.endif - -# Stash the current directory (some builds here actually change .CURDIR). -_CURDIR?=${.CURDIR} - -# Don't use target tool "strip" at install phase +# Override these to avoid use of host compiler, etc. INSTALL= ${TOOLDIR}/bin/binstall - -# "make build": Only build if the installed program is out-of-date. -# ("make all" and "make install" always build and install.) -.if make(build) -MKTOOLS?=yes -.if ${MKTOOLS} == "always" -build: -.else -build: ${TIMESTAMP} -${TIMESTAMP}: ${_CURDIR}/Makefile -.endif -.if ${MKTOOLS} != "no" - @cd ${_CURDIR} && ${MAKE} cleandir - @cd ${_CURDIR} && ${MAKE} all - @cd ${_CURDIR} && ${MAKE} install -.else - @echo "===> $@ must be updated, but MKTOOLS=no, so cannot build" - @false -.endif -.endif +MKDEP= CC=${HOST_CC:Q} ${TOOLDIR}/bin/mkdep diff --git a/tools/asn1_compile/Makefile b/tools/asn1_compile/Makefile index 9c6f12d1a68f..ac4a7654e9d5 100644 --- a/tools/asn1_compile/Makefile +++ b/tools/asn1_compile/Makefile @@ -1,15 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/10/25 07:45:14 thorpej Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:24 tv Exp $ HOST_SRCDIR= lib/libasn1/asn1_compile -DPSRCS= print_version.h -print_version.h: make-print-version.c ${.CURDIR}/../../include/heimdal/version.h - ${HOST_LINK.c} -o make-print-version ${>:M*.c} - ./make-print-version print_version.h - .include "${.CURDIR}/../Makefile.host" - -.PATH: ${DIST}/heimdal/lib/roken ${DIST}/heimdal/lib/vers -CLEANFILES+= print_version.h make-print-version make-print-version.lo - -${TIMESTAMP}: Makefile diff --git a/tools/binstall/Makefile b/tools/binstall/Makefile index 0bdc11f99ed0..28efed0cb8c9 100644 --- a/tools/binstall/Makefile +++ b/tools/binstall/Makefile @@ -1,10 +1,8 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:01:57 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:25 tv Exp $ HOSTPROG= binstall HOST_SRCDIR= usr.bin/xinstall .include "${.CURDIR}/../Makefile.host" -${TIMESTAMP}: ${SRCS} - -INSTALL:= ./binstall +INSTALL= ./binstall diff --git a/tools/compile_et/Makefile b/tools/compile_et/Makefile index d6349af7ad8a..6da748f5c3c8 100644 --- a/tools/compile_et/Makefile +++ b/tools/compile_et/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2001/09/21 23:01:08 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:25 tv Exp $ HOST_SRCDIR= usr.bin/compile_et HOST_SRCS= getarg.c print_version.c warnerr.c strupr.c get_window_size.c @@ -17,5 +17,3 @@ print_version.h: make-print-version.c ${.CURDIR}/../../include/heimdal/version.h .PATH: ${DIST}/heimdal/lib/roken ${DIST}/heimdal/lib/vers CLEANFILES+= print_version.h make-print-version make-print-version.lo - -${TIMESTAMP}: Makefile diff --git a/tools/config/Makefile b/tools/config/Makefile index e7ef3a1c6bc0..bc72d6631dcf 100644 --- a/tools/config/Makefile +++ b/tools/config/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:01:59 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:26 tv Exp $ HOST_SRCDIR= usr.sbin/config .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/crunchgen/Makefile b/tools/crunchgen/Makefile index bc7a6a9a64ca..cf205a540e22 100644 --- a/tools/crunchgen/Makefile +++ b/tools/crunchgen/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.2 2001/10/25 01:49:48 thorpej Exp $ +# $NetBSD: Makefile,v 1.3 2001/11/12 23:16:26 tv Exp $ HOST_SRCDIR= usr.bin/crunch/crunchgen .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/dbsym/Makefile b/tools/dbsym/Makefile index f17bf287baf7..fed9efcbcea6 100644 --- a/tools/dbsym/Makefile +++ b/tools/dbsym/Makefile @@ -1,17 +1,12 @@ -# $NetBSD: Makefile,v 1.1 2001/11/09 05:53:26 thorpej Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:26 tv Exp $ -DBSYM_TARET_PREFIX=${MACHINE_GNU_PLATFORM}- +.include -HOSTPROGNAME= ${DBSYM_TARET_PREFIX}dbsym +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-dbsym HOST_SRCDIR= gnu/usr.sbin/dbsym -BFDDIR= ${TOOLCHAINOBJDIR}/toolchain/bfd -IBERTYDIR= ${TOOLCHAINOBJDIR}/toolchain/libiberty +TOOLCHAINOBJ!= cd ${.CURDIR}/../toolchain && ${PRINTOBJDIR} +BFDDIR= ${TOOLCHAINOBJ}/build/bfd +IBERTYDIR= ${TOOLCHAINOBJ}/build/libiberty .include "${.CURDIR}/../Makefile.host" - -TOOLCHAINOBJDIR!= cd ${_CURDIR}/../toolchain && ${PRINTOBJDIR} - -HOST_CPPFLAGS+= -I${BFDDIR} -I${DIST}/include - -${TIMESTAMP}: ${SRCS} diff --git a/tools/gencat/Makefile b/tools/gencat/Makefile index dfa1bd0ed4b1..9d936e7c1f2f 100644 --- a/tools/gencat/Makefile +++ b/tools/gencat/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:01:59 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:27 tv Exp $ HOST_SRCDIR= usr.bin/gencat .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/groff/Makefile b/tools/groff/Makefile new file mode 100644 index 000000000000..66688751155a --- /dev/null +++ b/tools/groff/Makefile @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.1 2001/11/12 23:16:28 tv Exp $ + +MODULE= groff + +ALL_TARGET= src/include all + +.include "${.CURDIR}/../Makefile.gnuhost" + +.PATH: ${.CURDIR}/../../share/tmac +TMACDIR= ${TOOLDIR}/share/groff/tmac + +.for F in andoc doc doc-ditroff doc-common doc-nroff doc-syms doc2html +install.files: ${TMACDIR}/tmac.${F} +.PHONY: ${TMACDIR}/tmac.${F} +${TMACDIR}/tmac.${F}: ${F} +.if defined(UPDATE) + @if ! cmp ${.ALLSRC} ${.TARGET} 2>/dev/null; then \ + echo ${INSTALL_FILE:N-U:Q} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \ + ${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \ + fi +.else + ${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} +.endif +.endfor + +afterinstall: ${TMACDIR}/tmac.an +${TMACDIR}/tmac.an: ${TMACDIR}/tmac.andoc + ${INSTALL_FILE:N-U} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} diff --git a/tools/lex/Makefile b/tools/lex/Makefile index 1d192302f4e9..7d46ea42debe 100644 --- a/tools/lex/Makefile +++ b/tools/lex/Makefile @@ -1,10 +1,8 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:02:00 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:28 tv Exp $ HOST_SRCDIR= usr.bin/lex .include "${.CURDIR}/../Makefile.host" -${TIMESTAMP}: ${SRCS:Nscan.c:Nskel.c} initscan.c - scan.c: echo '#include ' >$@ diff --git a/tools/lint/Makefile b/tools/lint/Makefile index aab65871eaf5..5544194bb572 100644 --- a/tools/lint/Makefile +++ b/tools/lint/Makefile @@ -1,15 +1,8 @@ -# $NetBSD: Makefile,v 1.3 2001/10/25 02:23:21 thorpej Exp $ +# $NetBSD: Makefile,v 1.4 2001/11/12 23:16:28 tv Exp $ -XLINT_TARGET_PREFIX=${MACHINE_GNU_PLATFORM}- - -HOSTPROGNAME= ${XLINT_TARGET_PREFIX}lint +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-lint HOST_SRCDIR= usr.bin/xlint/xlint -HOST_CPPFLAGS= -DPATH_LIBEXEC=\"${TOOLDIR}/libexec\" +HOST_CPPFLAGS= -DPATH_LIBEXEC=\"${TOOLDIR}/libexec\" \ + -DTARGET_PREFIX=\"${MACHINE_GNU_PLATFORM}-\" .include "${.CURDIR}/../Makefile.host" - -HOST_CPPFLAGS+=-DTARGET_PREFIX=\"${XLINT_TARGET_PREFIX}\" - -.include "${_CURDIR}/Makefile.inc" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/lint/Makefile.inc b/tools/lint/Makefile.inc deleted file mode 100644 index c7ed9d9eed88..000000000000 --- a/tools/lint/Makefile.inc +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: Makefile.inc,v 1.1 2001/10/25 02:23:21 thorpej Exp $ - -HOST_CPPFLAGS+=-I${.CURDIR}/../lint1/arch/${MACHINE_CPU} - -.if ${OBJECT_FMT} == "a.out" -HOST_CPPFLAGS+=-DTARGET_OBJFMT_AOUT -.elif ${OBJECT_FMT} == "COFF" -HOST_CPPFLAGS+=-DTARGET_OBJFMT_COFF -.elif ${OBJECT_FMT} == "ELF" -HOST_CPPFLAGS+=-DTARGET_OBJFMT_ELF -.else -.BEGIN: - @echo "Unrecognized OBJECT_FMT ${OBJECT_FMT}" - @false -.endif diff --git a/tools/lint1/Makefile b/tools/lint1/Makefile index 43d3c6a6ff5d..9cf69afb1e8a 100644 --- a/tools/lint1/Makefile +++ b/tools/lint1/Makefile @@ -1,13 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2001/10/25 02:23:21 thorpej Exp $ +# $NetBSD: Makefile,v 1.4 2001/11/12 23:16:29 tv Exp $ -XLINT_TARGET_PREFIX=${MACHINE_GNU_PLATFORM}- - -HOSTPROGNAME= ${XLINT_TARGET_PREFIX}lint1 +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-lint1 HOST_SRCDIR= usr.bin/xlint/lint1 HOST_BINDIR= ${TOOLDIR}/libexec .include "${.CURDIR}/../Makefile.host" - -.include "${_CURDIR}/../lint/Makefile.inc" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/lint2/Makefile b/tools/lint2/Makefile index 0db789bef60b..1744938bc343 100644 --- a/tools/lint2/Makefile +++ b/tools/lint2/Makefile @@ -1,13 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2001/10/25 02:23:21 thorpej Exp $ +# $NetBSD: Makefile,v 1.4 2001/11/12 23:16:30 tv Exp $ -XLINT_TARGET_PREFIX=${MACHINE_GNU_PLATFORM}- - -HOSTPROGNAME= ${XLINT_TARGET_PREFIX}lint2 +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-lint2 HOST_SRCDIR= usr.bin/xlint/lint2 HOST_BINDIR= ${TOOLDIR}/libexec .include "${.CURDIR}/../Makefile.host" - -.include "${_CURDIR}/../lint/Makefile.inc" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/mdsetimage/Makefile b/tools/mdsetimage/Makefile index 0bbac35f29f8..d6281fcad3a6 100644 --- a/tools/mdsetimage/Makefile +++ b/tools/mdsetimage/Makefile @@ -1,17 +1,12 @@ -# $NetBSD: Makefile,v 1.3 2001/10/25 02:37:49 thorpej Exp $ +# $NetBSD: Makefile,v 1.4 2001/11/12 23:16:30 tv Exp $ -MDSETIMAGE_TARGET_PREFIX=${MACHINE_GNU_PLATFORM}- +.include -HOSTPROGNAME= ${MDSETIMAGE_TARGET_PREFIX}mdsetimage +HOSTPROGNAME= ${MACHINE_GNU_PLATFORM}-mdsetimage HOST_SRCDIR= gnu/usr.sbin/mdsetimage -BFDDIR= ${TOOLCHAINOBJDIR}/toolchain/bfd -IBERTYDIR= ${TOOLCHAINOBJDIR}/toolchain/libiberty +TOOLCHAINOBJ!= cd ${.CURDIR}/../toolchain && ${PRINTOBJDIR} +BFDDIR= ${TOOLCHAINOBJ}/build/bfd +IBERTYDIR= ${TOOLCHAINOBJ}/build/libiberty .include "${.CURDIR}/../Makefile.host" - -TOOLCHAINOBJDIR!= cd ${_CURDIR}/../toolchain && ${PRINTOBJDIR} - -HOST_CPPFLAGS+= -I${BFDDIR} -I${DIST}/include - -${TIMESTAMP}: ${SRCS} diff --git a/tools/menuc/Makefile b/tools/menuc/Makefile index 3a9b8197c2d4..a4a037d2d89e 100644 --- a/tools/menuc/Makefile +++ b/tools/menuc/Makefile @@ -1,11 +1,9 @@ -# $NetBSD: Makefile,v 1.2 2001/10/18 05:33:02 jmc Exp $ +# $NetBSD: Makefile,v 1.3 2001/11/12 23:16:31 tv Exp $ HOSTPROGNAME= menuc HOST_SRCDIR= usr.bin/menuc -HOSTFILES=menu_sys.def -HOST_FILESDIR= ${TOOLDIR}/share/misc +HOSTFILES= menu_sys.def +HOST_FILESDIR= ${TOOLDIR}/share/misc MKSHARE=no .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/mkdep/Makefile b/tools/mkdep/Makefile index 4a7956bbe3a7..93e049166ffe 100644 --- a/tools/mkdep/Makefile +++ b/tools/mkdep/Makefile @@ -1,7 +1,14 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:02:02 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:31 tv Exp $ HOST_SRCDIR= usr.bin/mkdep .include "${.CURDIR}/../Makefile.host" -${TIMESTAMP}: ${SRCS} +# Don't run mkdep on mkdep. +MKDEP= touch $@ || true + +# This is the only program that comes before binstall. +INSTALL= @true +${HOST_BINDIR}/${HOSTPROGNAME}:: mkdep + -rm -f $@ + cp mkdep $@ diff --git a/tools/mklocale/Makefile b/tools/mklocale/Makefile index e8cbb79b11d4..68e1fa6db7af 100644 --- a/tools/mklocale/Makefile +++ b/tools/mklocale/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/10/20 06:05:01 jmc Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:33 tv Exp $ HOST_SRCDIR= usr.bin/mklocale .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/msgc/Makefile b/tools/msgc/Makefile index bf7fd756f124..86d92775a531 100644 --- a/tools/msgc/Makefile +++ b/tools/msgc/Makefile @@ -1,11 +1,9 @@ -# $NetBSD: Makefile,v 1.2 2001/10/18 05:33:01 jmc Exp $ +# $NetBSD: Makefile,v 1.3 2001/11/12 23:16:33 tv Exp $ HOSTPROGNAME= msgc HOST_SRCDIR= usr.bin/msgc -HOSTFILES=msg_sys.def -HOST_FILESDIR=${TOOLDIR}/share/misc +HOSTFILES= msg_sys.def +HOST_FILESDIR= ${TOOLDIR}/share/misc MKSHARE=no .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/mtree/Makefile b/tools/mtree/Makefile index 9f7f3e4de16f..5573506ba823 100644 --- a/tools/mtree/Makefile +++ b/tools/mtree/Makefile @@ -1,8 +1,6 @@ -# $NetBSD: Makefile,v 1.2 2001/11/11 01:35:21 jmc Exp $ +# $NetBSD: Makefile,v 1.3 2001/11/12 23:16:33 tv Exp $ HOST_SRCDIR= usr.sbin/mtree +HOST_CPPFLAGS= -DNO_MD5 -DNO_RMD160 -DNO_SHA1 .include "${.CURDIR}/../Makefile.host" - -HOST_CPPFLAGS+=-DNO_MD5 -DNO_RMD160 -DNO_SHA1 -${TIMESTAMP}: ${SRCS} diff --git a/tools/rpcgen/Makefile b/tools/rpcgen/Makefile index a27a0f430cb2..e834efbd5fd0 100644 --- a/tools/rpcgen/Makefile +++ b/tools/rpcgen/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:02:02 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:34 tv Exp $ HOST_SRCDIR= usr.bin/rpcgen .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/texinfo/Makefile b/tools/texinfo/Makefile index 618800a35dbe..81c031e5b7be 100644 --- a/tools/texinfo/Makefile +++ b/tools/texinfo/Makefile @@ -1,49 +1,5 @@ -# $NetBSD: Makefile,v 1.6 2001/10/31 01:20:10 tv Exp $ +# $NetBSD: Makefile,v 1.7 2001/11/12 23:16:34 tv Exp $ -.include # for TOOLDIR +MODULE= texinfo -DIST= ${.CURDIR}/../../gnu/dist/texinfo -TIMESTAMP= ${TOOLDIR}/bin/makeinfo - -# Dependencies that trigger a rebuild. -${TIMESTAMP}: \ - ${.CURDIR}/Makefile \ - ${DIST}/ChangeLog - -.if ${USETOOLS} == "yes" -realall: texinfo.all -realinstall: texinfo.install -clean: texinfo.clean -.endif - -texinfo.configure: - rm -rf texinfo - mkdir texinfo - cd texinfo && \ - CC="${HOST_CC}" \ - CFLAGS="${HOST_CFLAGS}" \ - CPPFLAGS="${HOST_CPPFLAGS}" \ - LDFLAGS="${HOST_LDFLAGS}" \ - PATH="${TOOLDIR}/bin:$$PATH" \ - TEXINFO_MAINT="" \ - ${DIST}/configure \ - --disable-shared --with-included-gettext \ - --prefix=${TOOLDIR} - @touch $@ - -texinfo.all: texinfo.configure - cd texinfo && \ - PATH="${TOOLDIR}/bin:$$PATH" \ - ${MAKE} -j1 all LEX=true BISON=true DESTDIR= - -texinfo.install: -.for d in makeinfo util - cd texinfo/${d} && \ - PATH="${TOOLDIR}/bin:$$PATH" \ - ${MAKE} -j1 install LEX=true BISON=true DESTDIR= -.endfor - -texinfo.clean: - rm -rf texinfo* - -.include +.include "${.CURDIR}/../Makefile.gnuhost" diff --git a/tools/toolchain/Makefile b/tools/toolchain/Makefile index 3b301a619b01..9ecd46817c28 100644 --- a/tools/toolchain/Makefile +++ b/tools/toolchain/Makefile @@ -1,69 +1,24 @@ -# $NetBSD: Makefile,v 1.8 2001/11/01 01:52:45 thorpej Exp $ +# $NetBSD: Makefile,v 1.9 2001/11/12 23:16:35 tv Exp $ -.include # for TOOLDIR +.include -DIST= ${.CURDIR}/../../gnu/dist/toolchain -TIMESTAMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc +MODULE= toolchain -# Dependencies that trigger a rebuild. -${TIMESTAMP}: \ - ${.CURDIR}/Makefile \ - ${DIST}/ChangeLog \ - ${DIST}/bfd/ChangeLog \ - ${DIST}/binutils/ChangeLog \ - ${DIST}/gas/ChangeLog \ - ${DIST}/gcc/ChangeLog \ - ${DIST}/gcc/cp/ChangeLog \ - ${DIST}/gcc/f/ChangeLog \ - ${DIST}/ld/ChangeLog \ - ${DIST}/opcodes/ChangeLog +FIND_ARGS= \! \( -type d -name sim -prune \) -.if ${USETOOLS} == "yes" -realall: toolchain.all -realinstall: toolchain.install -clean: toolchain.clean +CONFIGURE_ENV= LANGUAGES="c c++ objc" +CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls + +.MAKEFLAGS+= MACHINE= \ + LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \ + INSTALL_CPP= + +ALL_TARGET= all-binutils all-gas all-ld all-gcc +INSTALL_TARGET= install-binutils install-gas install-ld install-gcc + +.if ${MKCROSSGDB:Uno} == "yes" +ALL_TARGET+= all-gdb +INSTALL_TARGET+=install-gdb .endif -.for f in aclocal autoconf autoheader automake -toolchain.configure: ${TOOLDIR}/bin/${f} -${TOOLDIR}/bin/${f}: stub.sh - ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -m ${BINMODE} $> $@ -.endfor - -toolchain.configure: - rm -rf toolchain - mkdir toolchain - cd toolchain && \ - CC="${HOST_CC}" \ - CFLAGS="${HOST_CFLAGS}" \ - CPPFLAGS="${HOST_CPPFLAGS}" \ - LDFLAGS="${HOST_LDFLAGS}" \ - PATH="${TOOLDIR}/bin:$$PATH" \ - LANGUAGES="c c++ objc" \ - ${DIST}/configure \ - --target=${MACHINE_GNU_PLATFORM} \ - --disable-shared --disable-nls \ - --prefix=${TOOLDIR} - cd toolchain/gcc && \ - mv -f Makefile Makefile.orig && \ - egrep -v '^(LIBGCC|LIBGCC1_TEST|LIBGCC2|INSTALL_LIBGCC) =' \ - Makefile.orig >Makefile - @touch $@ - -toolchain.all: toolchain.configure - cd toolchain && \ - PATH="${TOOLDIR}/bin:$$PATH" \ - ${MAKE} -j1 all-binutils all-gas all-ld all-gcc \ - LEX=true BISON=true MACHINE= DESTDIR= - -toolchain.install: - cd toolchain && \ - PATH="${TOOLDIR}/bin:$$PATH" \ - ${MAKE} -j1 install-binutils install-gas install-ld install-gcc \ - LEX=true BISON=true DESTDIR= - mv ${TOOLDIR}/bin/cpp ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp - -toolchain.clean: - rm -rf toolchain* - -.include +.include "${.CURDIR}/../Makefile.gnuhost" diff --git a/tools/toolchain/stub.sh b/tools/toolchain/stub.sh deleted file mode 100644 index f712b87297b3..000000000000 --- a/tools/toolchain/stub.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# $NetBSD: stub.sh,v 1.1 2001/08/14 11:02:03 tv Exp $ -# -# Do-nothing stub to override autoconf, automake, etc. -# diff --git a/tools/tsort/Makefile b/tools/tsort/Makefile index 2ac575b677bb..13626238fc48 100644 --- a/tools/tsort/Makefile +++ b/tools/tsort/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:02:04 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:36 tv Exp $ HOST_SRCDIR= usr.bin/tsort .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/tools/yacc/Makefile b/tools/yacc/Makefile index e6e272064a82..c967791268d6 100644 --- a/tools/yacc/Makefile +++ b/tools/yacc/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2001/08/14 11:02:04 tv Exp $ +# $NetBSD: Makefile,v 1.2 2001/11/12 23:16:36 tv Exp $ HOST_SRCDIR= usr.bin/yacc .include "${.CURDIR}/../Makefile.host" - -${TIMESTAMP}: ${SRCS} diff --git a/usr.bin/xlint/Makefile.inc b/usr.bin/xlint/Makefile.inc index 076f4ef47634..c2cea09134d3 100644 --- a/usr.bin/xlint/Makefile.inc +++ b/usr.bin/xlint/Makefile.inc @@ -1,8 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.5 2001/10/25 02:22:55 thorpej Exp $ +# $NetBSD: Makefile.inc,v 1.6 2001/11/12 23:16:36 tv Exp $ -.if !defined(HOSTPROG) -CPPFLAGS+=-I${.CURDIR}/../lint1/arch/${MACHINE_CPU} -.endif +CPPFLAGS+= -I${.CURDIR}/../lint1/arch/${MACHINE_CPU} .if exists(${.CURDIR}/../../Makefile.inc) .include "${.CURDIR}/../../Makefile.inc" diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index a9213564c8ec..7b3b01cba293 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -1,45 +1,38 @@ -# $NetBSD: Makefile,v 1.20 2001/10/25 02:22:55 thorpej Exp $ +# $NetBSD: Makefile,v 1.21 2001/11/12 23:16:37 tv Exp $ .include -.if !defined(XLINT_TARGET_PREFIX) -XLINT_TARGET_PREFIX= -.endif +PROG= lint1 +SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \ + init.c emit.c emit1.c +MAN= lint.7 +LDADD+= -ll +DPADD+= ${LIBL} +YHEADER= -PROG= lint1 -PROGNAME=${XLINT_TARGET_PREFIX}${PROG} -SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \ - init.c emit.c emit1.c -MAN= ${XLINT_TARGET_PREFIX}lint.7 -LDADD+= -ll -DPADD+= ${LIBL} -YHEADER=1 +CPPFLAGS+= -I${.CURDIR} -I. -CPPFLAGS+=-I${.CURDIR} -I. -.if !defined(HOSTPROG) .if ${OBJECT_FMT} == "a.out" -CPPFLAGS+=-DTARGET_OBJFMT_AOUT +CPPFLAGS+= -DTARGET_OBJFMT_AOUT .elif ${OBJECT_FMT} == "COFF" -CPPFLAGS+=-DTARGET_OBJFMT_COFF +CPPFLAGS+= -DTARGET_OBJFMT_COFF .elif ${OBJECT_FMT} == "ELF" -CPPFLAGS+=-DTARGET_OBJFMT_ELF +CPPFLAGS+= -DTARGET_OBJFMT_ELF .else .BEGIN: @echo "Unrecognized OBJECT_FMT ${OBJECT_FMT}" @false .endif -.endif # ! HOSTPROG -LINTFLAGS=-aehpz +LINTFLAGS= -aehpz WFORMAT=1 #hopeless -BINDIR= /usr/libexec +BINDIR= /usr/libexec scan.c: cgram.h -${XLINT_TARGET_PREFIX}lint.7: ${PROG} - sh ${.CURDIR}/makeman ${.OBJDIR}/${PROG} -m > ${.TARGET} - -CLEANFILES+=${MAN} +CLEANFILES+= ${MAN} +${MAN}: makeman ${PROG} + sh ${.ALLSRC} -m >${.TARGET} .ifndef HOSTPROG .include diff --git a/usr.bin/xlint/lint2/Makefile b/usr.bin/xlint/lint2/Makefile index c0f79a15c3ca..fefe94955784 100644 --- a/usr.bin/xlint/lint2/Makefile +++ b/usr.bin/xlint/lint2/Makefile @@ -1,19 +1,14 @@ -# $NetBSD: Makefile,v 1.9 2001/10/24 02:31:10 thorpej Exp $ +# $NetBSD: Makefile,v 1.10 2001/11/12 23:16:37 tv Exp $ -.PATH: ${.CURDIR}/../lint1 +.PATH: ${.CURDIR}/../lint1 -.if !defined(XLINT_TARGET_PREFIX) -XLINT_TARGET_PREFIX= -.endif - -PROG= lint2 -PROGNAME=${XLINT_TARGET_PREFIX}${PROG} -SRCS= main2.c hash.c read.c mem.c mem2.c chk.c msg.c emit.c emit2.c -MKMAN= no -CPPFLAGS+=-I${.CURDIR}/../lint1 -LINTFLAGS=-abehrz +PROG= lint2 +SRCS= main2.c hash.c read.c mem.c mem2.c chk.c msg.c emit.c emit2.c +MKMAN= no +CPPFLAGS+= -I${.CURDIR}/../lint1 +LINTFLAGS= -abehrz WFORMAT=1 # hopeless -BINDIR= /usr/libexec +BINDIR= /usr/libexec .ifndef HOSTPROG .include diff --git a/usr.bin/xlint/xlint/Makefile b/usr.bin/xlint/xlint/Makefile index 5fc87d1ddcca..6029192889eb 100644 --- a/usr.bin/xlint/xlint/Makefile +++ b/usr.bin/xlint/xlint/Makefile @@ -1,26 +1,13 @@ -# $NetBSD: Makefile,v 1.11 2001/10/25 02:22:56 thorpej Exp $ +# $NetBSD: Makefile,v 1.12 2001/11/12 23:16:37 tv Exp $ -.PATH: ${.CURDIR}/../lint1 +.PATH: ${.CURDIR}/../lint1 -PROG= xlint -SRCS= xlint.c mem.c -.if defined(XLINT_TARGET_PREFIX) -.if !defined(HOSTPROG) -CPPFLAGS+=-DTARGET_PREFIX=\"${XLINT_TARGET_PREFIX}\" -.endif -PROGNAME= ${XLINT_TARGET_PREFIX}lint -MAN= ${XLINT_TARGET_PREFIX}lint.1 -.else -PROGNAME= lint -MAN= lint.1 -.endif +PROG= xlint +SRCS= xlint.c mem.c +PROGNAME= lint +MAN= lint.1 -.if defined(XLINT_TARGET_PREFIX) -${XLINT_TARGET_PREFIX}lint1: ${.CURDIR}/lint.1 - cp ${.IMPSRC} ${.TARGET} -.endif - -CPPFLAGS+=-I${.CURDIR}/../lint1 +CPPFLAGS+= -I${.CURDIR}/../lint1 .ifndef HOSTPROG .include