Object file directory per compiler option combinations
问题 I was reading gnu make section 10.5.4 "How patterns match" and it does not sound like I can do what I want. I want to setup a directory structure where my source code is in one directory, and there are sub-directories to hold object files. One sub-directory for each build configuration. So I might have these files a.c debug/a.o # compiled with -g release/a.o # compiled with -O So I would like to make rules like this debug/%.o : %.c gcc -c -g %.c -o $@ release/%.o : %.c gcc -c -O %.c -o $@ But