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 $(RELEASE_DIR)? _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make