At 2004-05-26T12:41:57+01:00, Matthew Seaman wrote: > On Wed, May 26, 2004 at 12:15:57PM +0530, N. Raghavendra wrote: > > ### Makefile > > > > ## Create directory FOO if it does not exist. > > create_dir = if test ! -d foo ; then rm -f foo ; mkdir foo ; fi > > > > dir1: src1 > > $(create_dir:S/foo/$@/g) > > > > dir2: src2 > > $(create_dir:foo=$@) > > > > ### Makefile ends here > > Is there something wrong with the first form of the rule that means > you can't use it?
Hi Matthew, Thanks for the help. I would have liked to use the second substitution mechanism (foo=$@) because it is part of the POSIX specification of `make' (http://www.opengroup.org/onlinepubs/009695399/utilities/make.html), whereas the first form (S/foo/$@/g) doesn't seem to be so. > You have got a line: > > .PHONY: dir1 dir2 > > to force those rules to be applied even if dir1 or dir2 are newer than > their sources? Yes, I had tried that too, but it doesn't make the second rule work. The second rule does work with `gmake'. Cheers, Raghavendra. -- N. Raghavendra <[EMAIL PROTECTED]> | See mail headers for contact Harish-Chandra Research Institute | and OpenPGP details. _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"