[Top][All Lists]

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

Re: % pattern doesn't work

From: Paul Smith
Subject: Re: % pattern doesn't work
Date: Fri, 19 Feb 2016 10:37:49 -0500

On Fri, 2016-02-19 at 09:18 +0000, Yan Zhao OL Liu wrote:
> Recently I got a problem in using make.
> My code segment is below:

> $(RELEASE_DIR)/temp/%.o: %.cpp
>     ${CC} ${CFLAGS} -c -o $@ $<;
> For the above code, I just want all the generated object files
> redirected to $(RELEASE_DIR)/temp directory,
> but these object files are all directed to $(RELEASE_DIR) directory.

This rule will definitely put all objects into the $(RELEASE_DIR)/temp
directory: there's nothing wrong with it.

So, the problem must be elsewhere in your makefile, that you haven't
shown us.

In order for these object files to be built, they must exist as
prerequisites of another target.  When you list them as prerequisites
are you sure you've listed them with the /temp directory, and not just

reply via email to

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