%% Russell <[EMAIL PROTECTED]> writes: r> I thought i'd solve it using a pattern rule in each subdirectory:
r> %.o: %.c %.h r> $(CC) $(CFLAGS) -o $@ $< r> However, when a file matching %.o does not exist, r> make gives an error: *** No targets. Stop. r> How can i get 'make' do the command and create that .o file? I don't understand the question. Make prints "no targets" if you don't ask it to build anything. If you have no explicit targets in your makefile (for example, if the above implicit (pattern) rule is all the makefile contains), and you don't specify any targets to build on the command line (e.g., "make foo.o"), then make doesn't know what you want it to do. It does not simply root around in the directory looking for files that could possibly match the pattern rule and build them. You have to tell it what you want built. -- ------------------------------------------------------------------------------- Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: http://www.gnu.org http://make.paulandlesley.org "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
