[RFC PATCH] rfc: make 'make distclean' always use current Makefile.config

Tomi Ollila tomi.ollila at iki.fi
Sun Jan 8 14:08:56 PST 2017


On Sun, Jan 08 2017, David Bremner <david at tethera.net> wrote:

> Tomi Ollila <tomi.ollila at iki.fi> writes:
>
> I like the idea here; it's an annoying wait. Could we do something
> similar for make clean?

yes exact `make clean`, see below.

>
>> ... and not recreate it (slowly) if 'configure' changed, just to
>> be deleteted later during 'make distclean'.
> spellink
>
>> +# In case of 'make distclean' have configure as order-only prerequisite so
>> +# that Makefile.config is not recreated when configure is newer than it is.
>> +ifeq ($(MAKECMDGOALS),distclean)
>
> Two comments
>
> - do we want to check for exactly distclean, or distclean one of the
>   goals?
>
> - it turns out that specifying e.g. "make distclean all" is currently
>   broken (before your patch)

I tried to make support for 'make distclean all', but it just doesn't work
w/o heavy trickery.

After `make distclean all` has removed Makefile.config the prerequisities
of 'all' starts to run; it mysteriously fails (but if it did not, new
Makefile.config was not created -- but if new Makefile.config was
created, make would re-exec itself as `make distclean all` since a file
it included changed (and it would re-remove Makefile.config...)).

I tried an alternative for `make clean all`, where 'all:' rule line
in the beginning of Makefile.local had an ifeq alternative
`$(MAKE) all configure_options=$(configure_options)`
and without prerequisities 'notmuch notmuch-shared build-man ruby-bindings'.

"Unfortunately" e.g. emacs/Makefile.local also adds prerequisities for all:
-- and with those building emacs/notmuch-version.el fails
(I don't understand why, but it does). Setting all these prerequisities
could be ifneq()'d out but that is just complexity.


So, for developer convenience we can add cleanup speedup for
`make clean`, `make distclean` (and `make dataclean` if desired),
and user has to explicitly execute e.g. `make distclean && make all`
to do this kind of multiple targets...

Tomi

PS: I'd be interested to know whether it is possible to
`make distclean all` with autoconf-generated Makefiles...


More information about the notmuch mailing list