help-make
[Top][All Lists]
Advanced

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

Re: Why are circular rules not supported


From: Paul D. Smith
Subject: Re: Why are circular rules not supported
Date: Mon, 21 Nov 2005 13:22:16 -0500

%% "Olivier Cailloux" <address@hidden> writes:

  oc> It seems to me that they are harmless and usefull is some specific
  oc> situation. For example, imagine a makefile with these three rules:

  oc> foo.pdf: foo.ps
  oc>   (some rules to create a pdf from a ps file)

  oc> foo.ps: foo.pdf
  oc>   (some rules to create a ps from a pdf file)

  oc> foo.ps: foo.dvi
  oc>   (some rules to create a ps from a dvi file)

Note your second two rules can't both exist.  There can be only one
explicit rule to build any given target.  If you write that makefile
you'll get an error.

  oc> Imagine that I execute "make foo.pdf" from a folder where a file
  oc> "foo.dvi" exists. Then, there is only one reasonable way to create
  oc> foo.pdf.

The only reason you know that is because you have a priori knowledge
that make doesn't have.  Suppose you see a makefile like this:

    foo: bar ; <some rule to build foo from bar>

    bar: foo ; <some rule to build bar from foo>

When someone says "make", what do you do?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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