I am attempting to build a target file (with GNU make) if any of its surrounding files (files of the same type in the same directory) have changed. It seems simple enough but a solution has eluded me. Here is the key line of this makefile:
dir/%.Rd: file1 file2 dir/*.Rd
...
where there are 40-50 *.Rd files in /dir
(including %.Rd
). Although make
will automatically remove circular dependencies (the above code does work), I would like to remove the circularity of %.Rd
depending on itself. I have tried:
1)
dir/%.Rd: file1 file2 $(filter-out %, dir/*.Rd) # doesn't work; likely because % doesn't have meaning at this point -- second expansion
...
2)
dir/%.Rd: file1 file2 $(filter-out $@, dir/*.Rd) # doesn't appear to work: circular dependency warning
...
3)
dir/%.Rd: file1 file2 $$(filter-out $$@, dir/*.Rd) # same
...
4)
.SECONDEXPANSION:
dir/%.Rd: file1 file2 $$(filter-out $$@, dir/*.Rd) # same
...
This seems like a relatively simple problem and I'm sure I'm close. Any solutions/suggestions/workarounds are greatly appreciated.
Thanks in advance ...