%% Ronald Landheer-Cieslak <[EMAIL PROTECTED]> writes: rl> %.d : $(srcdir)/$(subst .d,.c,$@) rl> blah
rl> $@, however, is empty here (as the docs duely indicate). >> Why not just use the obvious: >> >> %.d : $(srcdir)/%.c rl> because the obvious doesn't work if there's a pathname in the rl> target filename (i.e. target == dir/file.d, prereq would become rl> dir/$(srcdir)/file.c because the stem of the pattern is "file", rl> not "dir/file"). Well sure, that won't work, but that's not the example you gave. It's hard to give solutions that work for examples that are not provided :). Typically what I do is not try to install the srcdir inside the pathname but rather have it at the top. If you have to put it inside you'll have to write a different rule for each value of "dir". You can use $(eval ...) (in the newest releases of GNU make) to do this without typing it all out. -- ------------------------------------------------------------------------------- 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://lists.gnu.org/mailman/listinfo/help-make
