Re: GNU make alleged of "bug" (was: PATCH: cdrecord: avoiding scsi device numbering for ide devices)

Sam Ravnborg
2004-08-20T04:41:20Z

On Fri, Aug 20, 2004 at 12:31:12AM +0200, Joerg Schilling wrote:

> -include does not work with Sun's make and it does not cure the bug in GNU make
> but hides it only.
>
> GNU make just violates the unwritten "golden rule" for all make programs:
>
> If you like to "use" anything, first check whether you have a rule
> that could make the file in question.
>
> For makefiles on the Command Line, GNU make follows this rule. If you are in an
> empty directory and call "gmake", GNU make will first try if "Makefile" or
> "makefile" could be retrieved using e.g. "sccs get Makefile" before GNU make
> tries to read the file.
>
> For makefiles that appear as argument to an include statement, GNU make ingnores
> this rule. GNU make instead, later (too late) executes the rule set and creates
> the missing files using known rules. In order to be able to do anything useful,
> GNU make then executes "exec gmake <old arg list>" after it is done with
> executing the rules. This is complete nonsense.
>
> Smake works this way:
>
> - if it is going to "include" a file, it checks whether there is a rule
> to make the file that is going to be included.
>
> - If the file has been "made", smake includes the file.
>
> - After including the file, smake clears the "has been made already"
> cache flags for the included file.
>
> - After all make files and all recursive include rules have been made and
> included, smake checks all rules again. This may result in rare cases
> that the rule for one of the the include file is executed again.
>
> As you noe see that GNU make behaves inconsistent, I hope you believe me that
> there is a bug in GNU make that should be fixed.

Please post this on the make-bug list then.

Sam