%% Maciej Walezak <[EMAIL PROTECTED]> writes: mw> $(TARGETS): $(@F)
You can't use automatic variables within rules like this. Automatic variables are defined only within command scripts. See the section "How make Reads a Makefile" in the GNU make manual. mw> The rule works i.e. copies given file from source to destination mw> directory if the file doesn't exist in destination directory but mw> fails if the destination file exists and local file is newer that mw> destination. Why? Since $(@F) expands to nothing in the context you're using it, the above rule is identical to just: $(TARGETS): with no prerequisites. So, if the target doesn't exist then it will be copied; if it does exist it's _always_ considered up-to-date (since it has no prerequisites to make it out-of-date). mw> Is there another way to achive the behavior I need? Static pattern rules. But, you'll have to write one for each subdirectory. -- ------------------------------------------------------------------------------- Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: http://www.gnu.org http://www.paulandlesley.org/gmake/ "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
