help-make
[Top][All Lists]
Advanced

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

Help w/ OBJECT_DIR


From: Steve deRosier
Subject: Help w/ OBJECT_DIR
Date: Tue, 22 Oct 2002 15:48:53 -0700

I seem to be having a problem with variable substitution when naming the
variable "OBJECT_DIR".  Basically, I have a tool that creates a file that I
include in my makefile that defines my object files and dependences for me.

The problem is, the tool defines the variable
OBJECTS = $(OBJECT_DIR)/entry.o $(OBJECT_DIR)/init.o ...

And it appears that I need to define OBJECT_DIR, otherwise it resolves to
"/entry.o /init.o ..."  Ok, that's fine and well...

I define
OBJECT_DIR = .

Now things seem to resolve to "./entry.o ./init.o ..." exactly as I intend.
But, I end up with the following error:
make: *** No rule to make target `/ORHBUTmp/entry.s', needed by `entry.o'.
Stop.

I have no /ORHBUTmp directory...this directory is a sub-directory off my
home tree.  (My pwd is /home/derosier/projects/ORHBUTmp ).

A make -p gives the following interesting snippet:
# Not a target:
5407.o: 5407.s
#  Implicit rule search has been done.
#  Implicit/static pattern stem: `5407'
#  Last modified 2002-10-22 14:17:13
#  File has been updated.
#  Successfully updated.
#  commands to execute (from `Makefile', line 70):
        $(asm) $*.s
        -mv -f $*.lst ./List/.


entry.o: entry.s /ORHBUTmp/entry.s
#  Implicit rule search has been done.
#  Implicit/static pattern stem: `entry'
#  Last modified 2002-10-22 15:27:51
#  File has not been updated.
#  commands to execute (from `Makefile', line 70):
        $(asm) $*.s
        -mv -f $*.lst ./List/.

Obviously /ORHBUTmp/entry.s doesn't exist.

If I change the variable name to anything but OBJECT_DIR it seems to work
(though it won't work with the tool I'm using, I just used it as an
experiment).  So if I change it to OBJECTDIR or even GOODOBJECT_DIR then the
make goes through ok.

I just don't get it.  Is there something special about the variable
OBJECT_DIR?  Or is this a weird bug either in my Makefile or in make itself?

Thanks for your help,
- Steve

The snippet below has been edited but is similar to the original:
------------------------------------------------------------------
OBJECT_DIR = .

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/.

.c.o:
        $(dcc) $(INCLUDE) $*.c
        -mv -f $*.lst ./List/.

.s.o:
        $(asm) $*.s
        -mv -f $*.lst ./List/.

.DONE:


#
# OBJECTS
#

$(TARGET).x  : $(LINKFILE)  $(OBJECTS)
        #my commands are here, but not relevant





reply via email to

[Prev in Thread] Current Thread [Next in Thread]