help-make
[Top][All Lists]
Advanced

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

Re: Re: customizing implicit rules


From: Aditya Kher
Subject: Re: Re: customizing implicit rules
Date: Tue, 23 Oct 2007 18:41:41 +0900

sorry. there was a typo.
it should be
 
all: $(objects)
 
cheers!

 
On 10/23/07, Chen Jun (陈军) <address@hidden> wrote:
Hello, Aditya Kher, 
 
It's something odd in your reply. Could you please present a complete makefile and show its output?
 
At least, the makefile snippet you gave below was not a reasonable makefile -- at least, no rule to make the target "objects".
 
CPP_DIR:=/home/user/source_dir
CPP=g++
objects:=$(patsubst ${CPP_DIR}/%.cpp,${CURDIR}/%.o,$(wildcard ${CPP_DIR}/*.cpp))
all: objects 
 
======== 2007-10-23 16:55:49 You wrote: ========
 
[[CC the Help-make]]
 
On 10/23/07, Aditya Kher  <address@hidden > wrote:
> Nope. that doesnt work
> consider my setup like this:
>
> /home/usr/boo/Makefile:
> ------
> CPP_DIR:=/home/user/source_dir
> CPP=g++
> objects:=$(patsubst ${CPP_DIR}/%.cpp,${CURDIR}/%.o,$(wildcard
> ${CPP_DIR}/*.cpp))
>
> all:objects
>
> -------
> I get
> %pwd
> /home/usr/boo
> %gmake -n
> g++ -o /home/usr/boo/../source_dir/foo.o ../source_dir/foo.cpp
>
> while without $CURDIR in the variable definition, I get
> %gmake -n
> g++ -o /home/usr/source_dir/foo.o ../source_dir/foo.cpp
>
> so its essentially the same regardless of use of $CURDIR.
> -aditya
>
>
> On 10/23/07, Chen Jun (陈军)  <address@hidden > wrote:
>  >
>  >
>  >
>  >
>  > Hello, Aditya Kher,
>  >  objects:=$(patsubst ${CPP_DIR}/%.cpp,${CURDIR}/%.o,$(wildcard  ${CPP_DIR}/*.cpp))
>  >
>  > Is that what you want?
>  >
>  > $(CURDIR) is a make internal variable representing current working directory.
>  >
>
 
 
-- 
Aditya Kher

= = = = = = = = = = = = = = = = = = = = = =

Best Regards

              Chen Jun (陈军)
              address@hidden
               2007-10-23



--
Aditya Kher
http://kher.org
reply via email to

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