Hello,

Not sure it is a bug but I think it deserves some attention. Here is an
MCVE:

```make
.PHONY: all clean

all:;

include a.mk

a.mk: b

b:
        @touch $@
        @printf '$$(info a.mk included)' > a.mk

clean:
        @rm -f a.mk b
```

First make invocation:

```bash
$ make
make: Nothing to be done for 'all'.
```

Second make invocation:

```bash
make
a.mk included
make: Nothing to be done for 'all'.
```

So we are in a situation where:

1. a makefile is included with the `include` directive (no `-include`),
2. the included makefile is not found,
3. make finds no rule to produce it and decides not to include it,
4. make executes a recipe for a prerequisite of the included makefile
that incidentally also produces the included makefile,
5. as the included makefile is finally found make does not fail... but
it does not read the included makefile.

This could be considered as contradictory with the documentation:

> After all makefiles have been checked, if any have
> actually been changed, make starts with a clean
> slate and reads all the makefiles over again.

Shouldn't make either fail or include?

BR.
-- 
Renaud Pacalet
Télécom ParisTech - LabSoC, c/o EURECOM
Campus SophiaTech,
450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
Tel : +33 (0) 4 9300 8402
Web : http://www.telecom-paristech.fr/

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to