help-make
[Top][All Lists]
Advanced

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

Re: Factorizing commands


From: Paul D. Smith
Subject: Re: Factorizing commands
Date: Tue, 8 Jul 2003 10:09:09 -0400

%% Sébastien Hinderer <address@hidden> writes:

  sh> I would like to write a Makefile to compile .vo (object files)
  sh> from .v (source files).  Apart from foo.v, foo.vo depends on a lot
  sh> of .vo files, whose names can _not_ be deduced syntactically from
  sh> the name of the target.

  sh> However, every rule that produces a .vo file from a .v file should
  sh> use the same command.

  sh> So, my question is : is it possible to write the vo-production
  sh> command only once, and having the other rules just for telling
  sh> make in which order to compile the targets.

Of course.

  %.vo : %.v
            ... build it ...


  foo.vo: foo.v bar.vo biz.vo baz.vo

  bar.vo: bar.v blah.vo goo.vo

etc. etc.  You can only define one command script per target, but you
can define prerequisites in as many different lines as you like.

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