www.digitalmars.com         C & C++   DMDScript  

c++.command-line - paths in inference rule (smake)

reply "dt" <tinkham ucalgary.ca> writes:
Running with smake.

In my makefile I have a listing of some source files that I am trying to
compile, but I want the .obj files in different directory. How do I do that
when I am using an inference rule of the .cpp.obj variety?

Smake help says to use this

{dependent_path}.dependent_ext{target_path}target_ext:
  commands

but is this right (only 1 period is shown)?


I have something like this in my makefile

OUTPUTDIR = C:\myoutdir

SRCS = $(SRC_PATH)\file1.cpp \
    $(SRC_PATH)\file2.cpp

.cpp.obj:
     $(CPP) -d -Jm -w -v1 -Ae -Ar -o-all -mn $(DEFINES) $(INCDIR) $<

all: $(SRCS:.cpp=.obj)


Can someone show me how to send my .obj files to $(OUTPUTDIR)  ?

Thanks,
Doug
Apr 11 2005
parent "tjulian" <tjulian removethis.oldi.com> writes:
dt wrote:

 Running with smake.
 
 In my makefile I have a listing of some source files that I am trying
 to compile, but I want the .obj files in different directory. How do
 I do that when I am using an inference rule of the .cpp.obj variety?
 
 Smake help says to use this
 
 {dependent_path}.dependent_ext{target_path}target_ext:
   commands
 
 but is this right (only 1 period is shown)?
 
 
 I have something like this in my makefile
 
 OUTPUTDIR = C:\myoutdir
 
 SRCS = $(SRC_PATH)\file1.cpp \
     $(SRC_PATH)\file2.cpp
 
 .cpp.obj:
      $(CPP) -d -Jm -w -v1 -Ae -Ar -o-all -mn $(DEFINES) $(INCDIR) $<
 
 all: $(SRCS:.cpp=.obj)
 
 
 Can someone show me how to send my .obj files to $(OUTPUTDIR)  ?
 
 Thanks,
 Doug

Inference rule would look like this: .cpp{$(OUTPUTDIR)}.obj: -- TimJ
Apr 12 2005