%% Bill Moseley <[EMAIL PROTECTED]> writes:

  bm> The problem I'm having is getting make to only run the program *once*.

  bm> I tried some rules like this:

  bm> html: $(version_file)
  bm>         cd $(srcdir)/../doc && bin/build

  bm> CHANGES.html: $(pod_dir)/CHANGES.pod
  bm>         $(MAKE) html

  bm> INSTALL.html: $(pod_dir)/INSTALL.pod
  bm>         $(MAKE) html

  bm> API.html: $(top_srcdir)/perl/API.pm
  bm>         $(MAKE) html

  bm> The above does not work, of course, because "make html" gets run
  bm> over and over for each target, instead of just once.

You need a stamp file: a single file that represents the last time the
build was performed.  Just write it like this:

 all: .html-stamp

 .html-stamp: $(version_file) $(pod_dir)/CHANGES.pod \
                 $(pod_dir)/INSTALL.pod $(top_srcdir)/perl/API.pm
         cd $(srcdir)/../doc && bin/build
         @touch .html-stamp

No need for an extra level of make recursion.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to