help-make
[Top][All Lists]
Advanced

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

Re: Problem with a directory name in a rule


From: Luke Shumaker
Subject: Re: Problem with a directory name in a rule
Date: Fri, 22 Oct 2010 21:04:34 -0400

On Fri, 2010-10-22 at 00:16 +0200, Vincent De Groote wrote:
> Hello,
> 
> I have a problem with a makefile (sic !).  gmake is executed in a build
> directory, with several subdirectories.
> I want to build a library from several sources, and then build an executable
> from a test file and that library.
> 
> If I do not try to put the object files in the objects directory, everything
> works fine.
> When I try to write the objects in the objects directory, gmake ends with
> the following error:
> 
> make: *** No rule to make target `objects/tester.o', needed by
> `bin/tester.exe'.  Stop.
> 
> In my mind, the rule
> 
> $(OBJECTS_DIR)/%.o : %.c makefile
> 
> should do the job.

Try

$(OBJECTS_DIR)/%.o : $(SOURCES_DIR)/%.o makefile

Now, if you set VPATH to include $(SOURCES_DIR), I'd expect what you
originally had to work.  However you did set VPATH to include
$(SOURCES_DIR), so I'm not sure.

~ LukeShu




reply via email to

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