help-make
[Top][All Lists]
Advanced

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

Re: Passing directory to submake


From: Paul D. Smith
Subject: Re: Passing directory to submake
Date: Sun, 20 Oct 2002 21:34:40 -0400

%% Russell <address@hidden> writes:

  >> I don't understand the question.  Make prints "no targets" if you
  >> don't ask it to build anything.  If you have no explicit targets in
  >> your makefile (for example, if the above implicit (pattern) rule is
  >> all the makefile contains), and you don't specify any targets to
  >> build on the command line (e.g., "make foo.o"), then make doesn't
  >> know what you want it to do.

  r> After a 'clean' operation, all the .o files get deleted, which
  r> means rules like: %.o : %.c will complain because there's no target
  r> .o files. How is this problem usually avoided?

Since, again, you have provided no concrete example I cannot really
answer your question because I don't understand what you're doing.

As I said before, you have to _TELL_ make what .o's you want to create.
Here's an example:

  %.o : %.c
            <compile it>

  all: foo.o bar.o baz.o boz.o biz.o
  .PHONY: all

Now, you've written a makefile that says "when the target 'all' is to be
built (which is what will happen by default unless you ask for a
different target on the make command line), try to build the
files foo.o, bar.o, baz.o, boz.o, and biz.o.  Because I have given you a
pattern rule for building ".o" from ".c", try to build these .o files
from the foo.c, bar.c, baz.c, boz.c, and biz.c files, respectively."

  r> What's the best book on GNU Make?

The GNU make manual.

  r> I'd like something that explains how large recursive makefile
  r> systems work.

I don't know of anything like that.  There's an O'Reilly book on
managing projects with make that may help, but it doesn't discuss the
specifics of GNU make; it talks about make in general.  As a result,
some of its advice might not be the best approach if you're using GNU
make (although it all should work, of course).

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