Subject: Re: usr.bin/make
To: James Chacon <jmc@NetBSD.org>
From: Max Okumoto <okumoto@ucsd.edu>
List: tech-toolchain
Date: 01/31/2005 02:55:54
--=-=-=

Luke Mewburn <lukem@NetBSD.org> writes:
> On Sun, Jan 30, 2005 at 12:22:27AM -0800, Max Okumoto wrote:
>   | 
>   | "Simon J. Gerraty" <sjg@crufty.net> writes:
>   | 
>   | > You might want send them to tech-toolchain@netbsd.org, to guage
>   | > response.  I'm totally swamped at work right now so won't be able to
>   | > do anything with them for a while.
>   | >
>   | > --sjg
>   | 
>   | Is there anyone that you know that might have time to
>   | look at some patches to clean up make(1)?
>
> Various subscribers to tech-toolchain ?
> Send a NetBSD PR ?
>
> BTW: what cleanups are you proposing?  (Just curious)
>
>
> Cheers,
> Luke.

Hi Guys,

I am a committer on the DragonFly project, and I have
been working with Harti who is a committer on FreeBSD,
to synchronize the source for make(1).

Simon, has told me that there are incompatible features
between the FreeBSD version of make(1).  So we can't
do the same with NetBSD.  But I still think there is
alot of common code in that we share so I would like
to contribute some of our patches.

Lots of style(9) fixes, and right now I am working on
cleaning up the buf.c buf.h code.

Harti has cleaned up the Lst_* functions, and alot of
other cleanups.

Is there a way to submit patches through the web interface?

                       Max Okumoto


The following two attachments are a script that and the diffs
generated by that script.  The script does the following:

    * removes spaces between function name and parameters.
       funcname (1, 2, 3) => funcname(1, 2, 3)

    * removes (void) from in front of unsed return
      values of functions.
      (void)funcname(1, 2) => funcname(1, 2)

% cd usr.bin/make
% mkdir obj
% make
% cp -r obj obj.orig

% ./fix_style.sh obj/make *.[ch]
% make clean
% make
% diff -r obj.orig obj



--=-=-=
Content-Type: application/x-sh
Content-Disposition: attachment; filename=fix_style.sh
Content-Description: Script to cleanup some style(9) problems.

#!/bin/sh
#
# Abstract: Fix some problems in 'C' src files.
#	o remove space between function name and parameters.
#	o remove (void) cast
#
# Output from nm of the final binary executable is used to generate
# a /bin/ed script, which fixes the problems.  The final executable
# is used because it should have most of the symbols.  CPP macros of
# course are not found in the executable, thus they are not handled.
#
# fix_style.sh binary [srcfiles]
#

OBJECT_FILE=obj/make
OBJECT_FILE=$1
shift;

nm $OBJECT_FILE | sort -u | awk '
END { printf "w\nq\n"; }
{
	if (($2 == "T") || ($2 == "t")) {
		# "[tab|space]funcname (" -> "[tab|space]funcname("
		printf "g/\\([\t ]\\)%s (/s//\\1%s(/g\n", $3, $3;
		# "^funcname (" -> "funcname("
		printf "g/^%s (/s//%s(/g\n", $3, $3;
		# "(funcname (" -> "(funcname("
		printf "g/(%s (/s//(%s(/g\n", $3, $3;

		# "(void)[tab|space]funcname(" -> "funcname("
		printf "g/(void)\\([\t ]\\)%s(/s//%s(/g\n", $3, $3;
		# "(void)funcname(" -> "funcname("
		printf "g/(void)%s(/s//%s(/g\n", $3, $3;
	}
}' > /tmp/$USER.editscript.$$

for file in "$@"; do
	echo -n "$file "
	ed -s $file < /tmp/$USER.editscript.$$
done
echo

rm /tmp/$USER.editscript.$$

--=-=-=
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=p1.1
Content-Transfer-Encoding: base64
Content-Description: p1.1

PyBvYmoKPyBwcy4wCkluZGV4OiBhcmNoLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3Qv
c3JjL3Vzci5iaW4vbWFrZS9hcmNoLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNDMKZGlmZiAt
dSAtcjEuNDMgYXJjaC5jCi0tLSBhcmNoLmMJMzAgT2N0IDIwMDQgMjA6NDk6MDUgLTAwMDAJMS40
MworKysgYXJjaC5jCTMxIEphbiAyMDA1IDEwOjM0OjUxIC0wMDAwCkBAIC0zODIsNyArMzgyLDcg
QEAKIAkJICAgIHJldHVybihGQUlMVVJFKTsKIAkJfSBlbHNlIHsKIAkJICAgIGduLT50eXBlIHw9
IE9QX0FSQ0hWOwotCQkgICAgKHZvaWQpTHN0X0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