Re: [patch] include_once in make

From: Max Khon <fjoe_at_samodelkin.net>
Date: Tue, 18 Mar 2008 00:14:51 +0600
Pietro Cerutti wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Dear all,
> 
> The updated patch implements the list traversal using the macros in
> lst.h (thanks Harti Brandt).
> 

> http://people.freebsd.org/~gahr/make.diff

Looks good

1) Unnecessary junk

--- make.orig/Makefile	2008-03-14 22:17:10.000000000 +0100
+++ make/Makefile	2008-03-17 14:54:38.000000000 +0100
_at__at_ -3,7 +3,7 _at__at_
  # $FreeBSD: src/usr.bin/make/Makefile,v 1.66 2008/03/04 22:32:58 
obrien Exp $

  PROG=	make
-CFLAGS+=-I${.CURDIR}
+CFLAGS+=-I${.CURDIR} -ggdb
  SRCS=	arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c	\

2) obey style(9):

+	LstNode *lNode;
+	if(once)
+		LST_FOREACH(lNode, &source_makefiles) 

+			if (!strcmp((char *)Lst_Datum(lNode), name)) 

+				return (1);

You should have empty line after lNode declaration.
You should have space after "if" statement.
You'd better enclose if-statement (and if-statement in LST_FOREACH) into 
curly braces because they are more than one line long

3) again, missing space after "if"

+	if(!add_ret)
+		ParsePushInput(fullname, NULL, NULL, 0);

I'd also give "add_ret" other name (more descriptive).

> Greetings,
> 
> Pietro Cerutti wrote:
> | Dear list,
> |
> | I have a patch which implements the include_once and sinclude_once
> | keywords in make. I think it would be useful in cases where a double
> | include would mess things up (i.e., ports).
> |
> | http://people.freebsd.org/~gahr/make.diff
> |
> | Any comment is welcome!
> |
> | Regards,
> |
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> 
> - --
> Pietro Cerutti
> gahr_at_FreeBSD.org
> 
> PGP Public Key:
> http://gahr.ch/pgp
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (FreeBSD)
> 
> iEYEAREKAAYFAkferiUACgkQwMJqmJVx946+CgCaA7rKXYY6Vo+3/N5AW2ItnSEY
> 0coAn1y2jgpmJfw1QX/uvIRVUiL1hcDm
> =zP7A
> -----END PGP SIGNATURE-----
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Mon Mar 17 2008 - 17:41:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:29 UTC