help-make
[Top][All Lists]
Advanced

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

Problem with a directory name in a rule


From: Vincent De Groote
Subject: Problem with a directory name in a rule
Date: Sat, 23 Oct 2010 08:40:39 +0200

Hello,

Thanks for your response.

I have already tried the rule $(OBJECTS_DIR)/%.o : $(SOURCES_DIR)/%.c
makefile

but this also doesn't work: it gives the sames results


Any other idea ?

Vincent De Groote




On 23 October 2010 03:04, Luke Shumaker <address@hidden> wrote:

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