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

Joerg Schilling
2004-08-19T22:32:37Z

Matthias Andree <matthias.andree@gmx.de> wrote:

> > Using:
> > -include hello.d
> > will result in a silent make.
>
> Indeed it will. However, Solaris' /usr/ccs/bin/make doesn't understand
> the "-include" form:
>
> make: Fatal error in reader: Makefile, line 5: Unexpected end of line seen
>
> include without leading "-" is fine. BSD make doesn't understand either
> form.
>
> J?rg, how about Sam's suggestion? It seems compatible with smake.

-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.

Jörg

--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily