bug-make
[Top][All Lists]
Advanced

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

Re: should includes for make -n to actually make?


From: Paul D. Smith
Subject: Re: should includes for make -n to actually make?
Date: Tue, 29 Jan 2002 17:08:55 -0500

%% "Marty Leisner" <address@hidden> writes:

  ml> Makefile.dep:
  ml>         $(CXX) $(CXXFLAGS) -MM *.cc > Makefile.dep

  ml> -include Makefile.dep

  ml> and it seems the dep rule took higher priority then -n.

  ml> I was under the impression -n would be non-destructive and merely
  ml> print stuff instead of creating files.

GNU make manual, section _How Makefiles are Remade_:

    ...
     When you use the `-t' or `--touch' option (*note Instead of
  Executing the Commands: Instead of Execution.), you would not want to
  use an out-of-date makefile to decide which targets to touch.  So the
  `-t' option has no effect on updating makefiles; they are really
  updated even if `-t' is specified.  Likewise, `-q' (or `--question')
  and `-n' (or `--just-print') do not prevent updating of makefiles,
  because an out-of-date makefile would result in the wrong output for
  other targets.  Thus, `make -f mfile -n foo' will update `mfile', read
  it in, and then print the commands to update `foo' and its prerequisites
  without running them.  The commands printed for `foo' will be those
  specified in the updated contents of `mfile'.
    ...

  ml> Is there a way to just show what would happen without executing
  ml> (even include files?)

The only thing I can think of is to check the options in MAKEFLAGS or
similar with an ifdef, and not do the include if the "n" option was
given.

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