help-make
[Top][All Lists]
Advanced

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

Re: limitations of 'include' directive?


From: Paul D. Smith
Subject: Re: limitations of 'include' directive?
Date: Fri, 25 Oct 2002 10:26:17 -0400

%% gk <address@hidden> writes:

  g> I am trying to include a makefile which contains the names of other
  g> makefiles to include.  If the first makefile is out of date, it is
  g> rebuilt using a pattern rule but after that point no more files can
  g> be included.

  g> It appears that make only gives you one shot when using
  g> auto-generated included makefiles: all included makefiles must be
  g> named in the top level makefile.

Make definitely will try to rebuild _all_ included makefiles, no matter
how deep they are.  Here's an example:

  $ cat Makefile
  %.mk : %.mk.in ; cp $< $@
  include one.mk
  all:;@echo $(FOO)

  $ cat one.mk.in
  FOO = one
  include two.mk

  $ cat two.mk.in
  FOO = two

  $ make
  Makefile:2: one.mk: No such file or directory
  cp one.mk.in one.mk
  one.mk:2: two.mk: No such file or directory
  cp two.mk.in two.mk
  two

  $ make
  two


Your rules are very complex so I didn't spend a lot of time on them, but
it sounds to me like your pattern rule is not matching the included
makefiles.

You can use "make -d" to watch what make is trying to rebuild and how
it's trying to match the rules.

If you can't figure it out please provide a small, simple example (like
I used above) that doesn't need lots of extra files and directories and
demonstrates the problem.

-- 
-------------------------------------------------------------------------------
 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]