Date: Mon, 14 Jul 2003 15:19:37 -0700 From: Gordon Tetlow <gordont@gnf.org> To: Tim Kientzle <kientzle@acm.org> Cc: Nate Lawson <nate@root.org> Subject: Re: Overdone rescue cleaning as part of buildworld? Message-ID: <20030714221937.GL12996@roark.gnf.org> In-Reply-To: <3F132B65.1040506@acm.org> References: <20030713214715.H15811@root.org> <20030714004042.A38507@hub.freebsd.org> <20030714160952.GD12996@roark.gnf.org> <3F130805.3060900@acm.org> <20030714194815.GJ12996@roark.gnf.org> <3F132B65.1040506@acm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--3rMDlCEgcaHQQFB+
Content-Type: multipart/mixed; boundary="/t6ASE28jIy1gGy9"
Content-Disposition: inline
--/t6ASE28jIy1gGy9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Jul 14, 2003 at 03:15:01PM -0700, Tim Kientzle wrote:
> Gordon Tetlow wrote:
> >On Mon, Jul 14, 2003 at 12:44:05PM -0700, Tim Kientzle wrote:
> >>Gordon Tetlow wrote:
> >>>>On Sun, Jul 13, 2003 at 09:49:46PM -0700, Nate Lawson wrote:
> >>>>>It appears /rescue is cleaning for way too much as part of buildworl=
d.
> >>>>>For instance, groff is NOT part of /rescue (or we have other things =
to
> >>>>>discuss. :) This adds a bit of time to buildworld, can it be remove=
d?
> >>>>
> >>Yeah, I took a few shortcuts; /rescue does build far more in
> >>OBJDIR than it needs to, and similarly cleans much more than it needs
> >>to. (Those extra dirs are never populated, but building and cleaning
> >>them does still take time.) I believe the attached patch addresses
> >>this issue; it trims down /usr/obj/usr/src/rescue/rescue/usr/src/... to
> >>just the directories actually needed.
> >
> >This solution is kinda hackish, I have a more generic solution that makes
> >it easier to add programs without having to specifically add
> >CRUNCH_SRCDIR_foo to every program outside of src/bin and src/sbin. I'm
> >hoping to iron out the wrinkles today and post the patches. Other than
> >that the patch is pretty much complete.
>=20
> Great! Looking forward to it.
Attached is the patch. It basically makes CRUNCH_PROGS into a per
directory item and then only does a make obj on the per program
directory. I've incorporated the CRUNCH_SRCDIR_foo stuff you had
although I had come up with a similar solution.
It's lightly tested, some more eyes looking at it would be useful.
I'm currently running it through a buildworld.
-gordon
--/t6ASE28jIy1gGy9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rescue.diff"
Content-Transfer-Encoding: quoted-printable
--- //depot/vendor/freebsd/src/rescue/rescue/Makefile 2003/07/11 10:38:05
+++ //depot/user/gordon/dynamic/src/rescue/rescue/Makefile 2003/07/14 13:04=
:49
@@ -1,4 +1,4 @@
-#$FreeBSD: src/rescue/rescue/Makefile,v 1.6 2003/07/11 16:57:43 gordon Exp=
$
+#$FreeBSD: src/rescue/rescue/Makefile,v 1.5 2003/06/30 21:13:56 gordon Exp=
$
# @(#)Makefile 8.1 (Berkeley) 6/2/93
=20
PROG=3D rescue
@@ -66,9 +66,9 @@
# WARNING: Changing this list may require adjusting
# /usr/include/paths.h as well! You were warned!
#
-CRUNCH_SRCDIRS+=3D$(.CURDIR)/../../bin $(.CURDIR)/../../usr.bin
-CRUNCH_PROGS=3Dcat chflags chio chmod cp date dd df domainname echo ed \
- expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \
+CRUNCH_SRCDIRS+=3Dbin
+CRUNCH_PROGS_bin=3Dcat chflags chio chmod cp date dd df domainname echo \
+ ed expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \
realpath rm rmdir setfacl sh sleep stty sync test
CRUNCH_LIBS+=3D-lcrypt -lcrypto -ledit -lkvm -ll -lm -ltermcap -lutil
=20
@@ -82,18 +82,18 @@
CRUNCH_ALIAS_ed=3D red
=20
.if !defined(NO_RCMNDS)
-CRUNCH_PROGS+=3D rcp
+CRUNCH_PROGS_bin+=3D rcp
.endif
=20
.if !defined(NO_TCSH)
-CRUNCH_PROGS+=3D csh
+CRUNCH_PROGS_bin+=3D csh
CRUNCH_ALIAS_csh=3D -csh tcsh -tcsh
CRUNCH_SUPPRESS_LINK_-csh=3D1
CRUNCH_SUPPRESS_LINK_-tcsh=3D1
.endif
=20
#Is rmail of any use at all here? I think not.
-#CRUNCH_PROGS+=3D rmail =20
+#CRUNCH_PROGS_bin+=3D rmail =20
=20
###################################################################
# Programs from standard /sbin
@@ -104,8 +104,8 @@
# Note that mdmfs and shutdown have their own private 'pathnames.h'
# headers in addition to the standard 'paths.h' header.
#
-CRUNCH_SRCDIRS+=3D$(.CURDIR)/../../sbin
-CRUNCH_PROGS+=3Datm adjkerntz atacontrol badsect bsdlabel camcontrol \
+CRUNCH_SRCDIRS+=3Dsbin
+CRUNCH_PROGS_sbin=3Datm adjkerntz atacontrol badsect bsdlabel camcontrol \
ccdconfig clri comcontrol conscontrol devfs dmesg dump \
dumpfs dumpon fore_dnld fsck fsck_ffs fsck_msdosfs fsdb \
fsirand gbde growfs ifconfig ilmid init ip6fw ipf ipfs ipfstat \
@@ -124,7 +124,7 @@
-lgeom -lmd -lreadline -lsbuf -lufs -lz=20
=20
.if ${MACHINE_ARCH} =3D=3D "i386"
-CRUNCH_PROGS+=3D cxconfig fdisk
+CRUNCH_PROGS_sbin+=3D cxconfig fdisk
CRUNCH_ALIAS_bsdlabel=3D disklabel
#CRUNCH_PROGS+=3D mount_nwfs mount_smbfs
#CRUNCH_LIBS+=3D -lncp -lsmb
@@ -135,11 +135,11 @@
.endif
=20
.if ${MACHINE_ARCH} =3D=3D "ia64"
-CRUNCH_PROGS+=3D mca gpt fdisk
+CRUNCH_PROGS_sbin+=3D mca gpt fdisk
.endif
=20
.if ${MACHINE_ARCH} =3D=3D "sparc64"
-CRUNCH_PROGS+=3D sunlabel
+CRUNCH_PROGS_sbin+=3D sunlabel
.endif
=20
.if ${MACHINE_ARCH} =3D=3D "alpha"
@@ -147,7 +147,7 @@
.endif
=20
.if ${MACHINE_ARCH} =3D=3D "amd64"
-CRUNCH_PROGS+=3D fdisk
+CRUNCH_PROGS_sbin+=3D fdisk
CRUNCH_ALIAS_bsdlabel=3D disklabel
.endif
=20
@@ -162,26 +162,26 @@
CRUNCH_ALIAS_mount_std=3D mount_devfs mount_fdescfs mount_linprocfs mount_=
procfs
=20
# dhclient has historically been troublesome...
-CRUNCH_PROGS+=3Ddhclient
+CRUNCH_PROGS_sbin+=3Ddhclient
CRUNCH_BUILDOPTS_dhclient=3D-DRELEASE_CRUNCH -Dlint
=20
##################################################################
# Programs from stock /usr/bin
#=20
-CRUNCH_SRCDIRS+=3D$(.CURDIR)/../../usr.bin
-CRUNCH_SRCDIRS+=3D$(.CURDIR)/../../gnu/usr.bin
+CRUNCH_SRCDIRS+=3Dusr.bin
+CRUNCH_SRCDIRS+=3Dgnu/usr.bin
=20
-CRUNCH_PROGS+=3Dwall
+CRUNCH_PROGS_usr.bin+=3Dwall
=20
-CRUNCH_PROGS+=3Dgzip
+CRUNCH_PROGS_gnu/usr.bin+=3Dgzip
CRUNCH_ALIAS_gzip=3Dgunzip gzcat zcat
=20
-CRUNCH_PROGS+=3Dbzip2
+CRUNCH_PROGS_usr.bin+=3Dbzip2
CRUNCH_ALIAS_bzip2=3Dbunzip2 bzcat
CRUNCH_LIBS+=3D-lbz2
=20
-CRUNCH_PROGS+=3Dtar
-CRUNCH_PROGS+=3Dvi
+CRUNCH_PROGS_gnu/usr.bin+=3Dtar
+CRUNCH_PROGS_usr.bin+=3Dvi
CRUNCH_ALIAS_vi=3Dex
=20
##################################################################
@@ -204,7 +204,8 @@
=20
# Program names and their aliases contribute hardlinks to 'rescue' executa=
ble,
# except for those that get suppressed.
-.for P in $(CRUNCH_PROGS)
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
.ifndef CRUNCH_SUPPRESS_LINK_${P}
LINKS +=3D $(BINDIR)/$(PROG) $(BINDIR)/$(P)
.endif
@@ -214,6 +215,7 @@
.endif
.endfor
.endfor
+.endfor
=20
all: $(PROG)
exe: $(PROG)
@@ -221,7 +223,7 @@
$(CONF): Makefile
echo \# Auto-generated, do not edit >$(.TARGET)
.for D in $(CRUNCH_SRCDIRS)
- echo srcdirs $(D) >>$(.TARGET)
+ echo srcdirs $(.CURDIR)/../../$(D) >>$(.TARGET)
.endfor
.ifdef CRUNCH_BUILDOPTS
echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET)
@@ -229,7 +231,8 @@
.ifdef CRUNCH_LIBS
echo libs $(CRUNCH_LIBS) >>$(.TARGET)
.endif
-.for P in $(CRUNCH_PROGS)
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
echo progs $(P) >>$(.TARGET)
.ifdef CRUNCH_SRCDIR_${P}
echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET)
@@ -241,6 +244,7 @@
echo ln $(P) $(A) >>$(.TARGET)
.endfor
.endfor
+.endfor
=20
=20
$(OUTPUTS): $(CONF)
@@ -256,7 +260,7 @@
# shell scripts so we can remove this nonsense.
build-tools:
.for _tool in bin/csh bin/sh=20
- cd ${.CURDIR}/../../${_tool}; \
+ cd $(.CURDIR)/../../${_tool}; \
MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} make DIRPRFX=3Drescue/${_tool} build-too=
ls
.endfor
=20
@@ -266,7 +270,15 @@
# targets should NOT be propagated into the components.
cleandepend cleandir obj objlink:
.for D in $(CRUNCH_SRCDIRS)
- cd ${D} && MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} make ${.TARGET}
+.for P in $(CRUNCH_PROGS_$(D))
+.ifdef CRUNCH_SRCDIR_${P}
+ cd ${CRUNCH_SRCDIR_$(P)} && \
+ MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} make ${.TARGET}
+.else
+ cd $(.CURDIR)/../../${D}/${P} && \
+ MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} make ${.TARGET}
+.endif
+.endfor
.endfor
=20
clean:
@@ -274,8 +286,16 @@
if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} make -f $(OUTMK) clean; \
fi
-.for D in $(CRUNCH_SRCDIRS) $(EXTRA_SRCDIRS)
- cd ${D} && MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} make clean
+.for D in $(CRUNCH_SRCDIRS)
+.for P in $(CRUNCH_PROGS_$(D))
+.ifdef CRUNCH_SRCDIR_${P}
+ cd ${CRUNCH_SRCDIR_$(P)} && \
+ MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} make ${.TARGET}
+.else
+ cd $(.CURDIR)/../../${D}/${P} && \
+ MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} make ${.TARGET}
+.endif
+.endfor
.endfor
=20
.include <bsd.prog.mk>
--/t6ASE28jIy1gGy9--
--3rMDlCEgcaHQQFB+
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)
iD8DBQE/Eyx5Ru2t9DV9ZfsRAk4TAKCLsg8Yom009eM4rv672DB703+3uQCgndzX
oAOqbMFTDb/EfX7vC8U5Qcs=
=ZRXG
-----END PGP SIGNATURE-----
--3rMDlCEgcaHQQFB+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030714221937.GL12996>
