[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

no rule to build included makefile but make does not fail

From: pacalet
Subject: no rule to build included makefile but make does not fail
Date: Tue, 4 Dec 2018 08:38:43 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.1


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

.PHONY: all clean


include a.mk

a.mk: b

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

        @rm -f a.mk b

First make invocation:

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

Second make invocation:

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?

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]