Using Implicit rule while browsing through directories to compile in GNU Make

Nick Ng nick@std.abk.nec.co.jp
Tue Feb 13 01:42:00 GMT 2001


Hi there:

I have a directory in my development like:
	src -
		prg1
		prg2
		prg3

Where all of source file (C) are stored in 3 different sub-dirs. If I
defined the implicit rule like:

%.o : %.c
        $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

Can anyone please tell me how to ask make to browse through each of these
sub-dirs and apply the implicit rule on it. I understood a PHONY target can
be a good starting point to kick off multiple target build. Any help is
appreciated :) :) !



More information about the Gcc-help mailing list