bug-make
[Top][All Lists]
Advanced

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

Re: Make feature rq: Non-pattern rules with multi-target commands


From: Paul D. Smith
Subject: Re: Make feature rq: Non-pattern rules with multi-target commands
Date: Mon, 21 Oct 2002 14:52:35 -0400

%% Henning Makholm <address@hidden> writes:

  >> .foobar.temp: foobar.sml
  >>        mosmlc $<
  >>        touch $@
  >> binary: .foobar.temp

  >> Gross, but it usually works.

  hm> Only when nothing (or at least nothing with commands) depends on
  hm> `binary': since the empty command does not change its timestamp, make
  hm> will assume that it is not necessary to to futher recompilations even
  hm> if `binary' did change as the result of the mosmlc command. Here is
  hm> what I get, testing your construction:

  hm> pc-043:~/tmp/foo$ cat Makefile
  hm> final: interm
  hm>         cat interm > final
  hm> interm: stamp
  hm> stamp: source
  hm>         cat source > interm
  hm>         touch stamp

Sorry, I guess I wasn't explicit enough.  When I said "binary" I meant
the actual target that uses the files, _NOT_ some intermediate file with
no rules.  In other words, to rewrite your example, I meant something
like this:

  final: stamp
        cat interm > final

  stamp: source
        cat source > interm
        touch stamp

IOW, you don't make targets depend on the output files (because make
can't be instructed on how to properly create them); instead you make
targets depend on the stamp file, but use the output files in the rule.

Like I said, gross, but it usually works :).

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