help-make
[Top][All Lists]
Advanced

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

Re: Help w/ OBJECT_DIR


From: Paul D. Smith
Subject: Re: Help w/ OBJECT_DIR
Date: Tue, 22 Oct 2002 22:09:22 -0400

When asking for help or reporting a problem, please _always_ provide the
version number of the software you're using, and the type of system
you're running it on.

If you're not using the latest, GNU make 3.80, then please upgrade to
that version and try again.


There is no special handling of a variable OBJECT_DIR in GNU make, nor
is there special handling of _any_ variable that might result in the
behavior you're seeing.

Note that this, however:

  OBJECTS = $(OBJECT_DIR)/5407.o $(OBJECT_DIR)/entry.o $(OBJECT_DIR)/init.o \
  $(OBJECT_DIR)/main.o $(OBJECT_DIR)/vectors.o

  #
  # GENERATION RULES
  #
  .SUFFIXES: .cpp .c .s

  .cpp.o:
          $(dplus) $(INCLUDE) $*.cc
          -mv -f $*.lst ./List/.
    ...etc...

will not work if the value of OBJECT_DIR is anything _other_ than ".".
A suffix rule like ".cpp.o" tells make how to build a file XXX.o from a
file XXX.cpp--but suppose OBJECT_DIR=objdir.  Now you want to build a
file objdir/XXX.o, so make will only use your rule if there is an
objdir/XXX.cpp, which there probably isn't.


Also, don't forget to add ".o" to the .SUFFIXES list above; _both_
elements of the suffix must be defined to make it a suffix rule (note
that the default .SUFFIXES list already contains these suffixes, though,
so unless you're clearing it first it doesn't matter).

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