Re: [patch] include_once in make

From: Pietro Cerutti <gahr_at_FreeBSD.org>
Date: Mon, 17 Mar 2008 18:14:48 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Harti Brandt wrote:
| On Mon, 17 Mar 2008, Pietro Cerutti wrote:
|
| PC>I have a patch which implements the include_once and sinclude_once
| PC>keywords in make. I think it would be useful in cases where a double
| PC>include would mess things up (i.e., ports).
| PC>
| PC>http://people.freebsd.org/~gahr/make.diff
| PC>
| PC>Any comment is welcome!
|
| I think your patch silently removes the recently added feature that
| Makefiles are only remade when .MAKEFILEDEPS is defined as a target.

Uhm.. why should it?

|
| Style:
|
| - in Main_AddSourceMakefile you should use the macros and functions from
| lst.h instead of rolling your own loop

The functions in lst.h don't implement looking for an element comparing
lexicographically equal to a given one. It's a specialization of
"equals". Better to implement it in lst.c?

| - paranthesis missing in return 1.

Thanks, fixed

|
| For the semantics:
|
| If it's needed, then, well. Given that a Makefile should be declarative
| not procedural it looks not strongly necessary, but I may be wrong. It
| introduces subtle semantic differences if the included makefile has
| procedural elements (.if or .for):
|
| .include_once Makefile.inc
| FOO = 1
| .include_once Makefile.inc
|
| If Makefile.inc does different things depending on the setting of FOO,
bug
| hunting will get though, especially if the first .include_once is in and
| included file and not easily visible.
|
| If you're going to commit this, make sure to also document it.
|
| harti


- --
Pietro Cerutti
gahr_at_FreeBSD.org

PGP Public Key:
http://gahr.ch/pgp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEAREKAAYFAkfepwgACgkQwMJqmJVx945BoQCgti30Bsa3OE3P95GwdC3MvOQS
Jo0An1s5Druln+5n7QiLJHcMJ75veLe/
=ki7a
-----END PGP SIGNATURE-----
Received on Mon Mar 17 2008 - 16:14:52 UTC

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