[Top][All Lists]

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

Re: Annoyingly cautious make rules

From: Paul Eggert
Subject: Re: Annoyingly cautious make rules
Date: Fri, 02 Dec 2011 22:35:12 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

On 12/02/11 21:48, Stefan Monnier wrote:
> After that, "make" should take care of rebuilding configure if/when
> needed

There's no practical way for "make" to do that, and Emacs's
current make rules do not do that.  For example, if I manually
edit Makefile.in so that the rule for 'configure' looks like this:

        $(srcdir)/configure: $(AUTOCONF_INPUTS)
                cd ${srcdir} && autoconf
                echo '#foo' >>$@ # <-- I added this line.

then "make" should rebuild "configure".  But "make" does not,
as "Makefile.in" is not a dependency for "configure".

We could fix this particular problem by adding "Makefile.in" as a
dependency for every file that gets built in every directory.
But (1) even that would not suffice in general, and (2) that would
cause more builds to run unnecessarily and annoyingly slowly.

Emacs makefiles, like all practical makefiles, are an
engineering compromise between correctness and speed.  There's
no practical way to get 100% correctness with "make" after an
arbitrary maintainer change to source files.  Instead, we strive for
correctness a high percentage of the time, in such a way that
maintainers should have a good idea of all the issues that might cause
incorrectness and how to avoid these issues.

One possible rule of thumb, for example, is the idea that
"make" runs fairly quickly and works unless you have edited
the build procedure, and in the latter case you should run
"make bootstrap" which is much safer but also much slower.
That is an easy guideline to remember, and surely we can get this
to work a high percentage of the time.  Perhaps you prefer
a different guideline, and if so we can try to get that
other guideline to work.  But the rule cannot be that
"make" always works unaided: that's not practical.

reply via email to

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