[Top][All Lists]

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

Re: How-to

From: Paul D. Smith
Subject: Re: How-to
Date: Thu, 5 Apr 2001 18:32:41 -0400

%% address@hidden (John Alvord) writes:

  ja> I've been working to rework some makefiles to they work correctly
  ja> under parallel execution conditions.

  ja> all: a b c

  ja> a:

  ja> b:

  ja> c:

  ja> Lets say "a" is a rule which creates some directories which are used
  ja> by "b" and "c". How can I make sure that "b" and "c" are postponed
  ja> until "a" completes?

You must list b and c as prerequisites of a.

Alternatively you'll have to use some kind of recursive make

There is no way to specify an ordering apart from dependencies in GNU
make (or most (all?) other makes); this is another oft-requested
feature.  Well, if not oft-requested than at least one I've often wished
for :).

For directory creation in particular I generally strongly discourage
people from doing it with rules.  Use a $(shell ...) function instead,
like this:

  __dummy := $(shell mkdir b c)

This is a kind of "BEGIN" preop declaration: it will be expanded and
executed as the makefile is being read in, before any rules are invoked.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "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]