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

Re: dh_make's "rules" file



On Tue, Jul 10, 2001 at 12:12:01PM +0200, Joost Kooij wrote:

> On Mon, Jul 09, 2001 at 10:50:47PM -0400, Matt Zimmerman wrote:
> > If your package produces only one binary, and you can be sure that it will
> > be the last thing created by the build process, then it should be safe.
> > You must be sure not to specify any commands in debian/rules after the call
> > to $(MAKE), though.
> 
> There is no limiting to only one binary,  why do you think so?  Of course you
> must be sure to know what you're writing a rules Makefile for and how the
> build process works.  I do not see how this is relevant to the artificial
> stamps, btw.

The point is that using an upstream makefile target for the debian/rules target
ties the build process to the _internal_ details of the upstream build process.
If upstream adds, removes, or renames a binary, more changes must be made to
debian/rules than would be otherwise necessary.  For what benefit?

Using the timestamp files separates the Debian build targets from the upstream
makefile targets.

> The stages of the build process are best represented by the stages of the
> build process per se.  The artificial stamps are added onto the build process
> and are not an essential part of it.  They may convenient to some in some
> situations, but you lose on elegance, generally. 
>
> In the long run, you are better of mastering the art of makefiles.  I wrote a
> rules file using contrived stamps and it was ugly, mostly because I did not
> understand the idea behind it very well.  It only really dawned to me after I
> had finally studied make more seriously.  Then I was not only able to fix my
> embarrassing mistakes, but also to do things properly, without "stamps".  Had
> I been happy with the stamps, they might have been in my way to understanding
> things forever, blocking any progress I could be making otherwise.

I am well-versed in the art of makefiles, and I still believe that the stamps
are a good idea.  In one of my packages, the "configuration" stage doesn't
produce any new files: it just runs a Perl script to do some substitution on an
arbitrary number existing files.  Do you think it would be better to use all of
these files as the dependencies of the "configure" target, even though the list
(and any possible rules for generating a list) might change from one release to
the next?

It is appropriate to use timestamp files in a makefile when you cannot be
certain what actions will be performed by a call to an external script or
makefile.  You can test for its successful execution, but it doesn't make sense
to duplicate code and data to do the same dependency checks that are done in
the external script or makefile.

> So I would not like to forbid people to use the stamps, I just want to
> encourage people to learn make.  Then, when you understand the differences
> and tradeoffs between contrived stamps and natural make targets, should you
> decide what is best for your package.  Encouraging people to use the "stamps"
> blindly is imho not doing a favor to these people, debian and debian's users.

I am certainly not saying that Debian maintainer shouldn't learn make.  They
should.  Make is used in every Debian source package that I've examined, and
that alone makes it worth learning.

-- 
 - mdz



Reply to: