Hello everybody, suppose, I've got the following directory layout and the Makefile `test.mk' attached:
--8<---------------cut here---------------start------------->8--- nic@nic-desktop:~$ find lib lib lib/.deps lib/blah lib/test.f90 nic@nic-desktop:~$ --8<---------------cut here---------------end--------------->8--- The following works: --8<---------------cut here---------------start------------->8--- nic@nic-desktop:~$ cd lib nic@nic-desktop:~/lib$ LC_ALL=C make -r -f ~/test.mk .deps/test.fmc echo ".deps/test.fmc : test.f90" .deps/test.fmc : test.f90 nic@nic-desktop:~/lib$ --8<---------------cut here---------------end--------------->8--- But with ~/ being the cwd, it won't: --8<---------------cut here---------------start------------->8--- nic@nic-desktop:~/lib$ cd ~/ nic@nic-desktop:~$ LC_ALL=C make -r -df ~/test.mk lib/.deps/test.fmc GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for x86_64-pc-linux-gnu Reading makefiles... Reading makefile `/home/nic/test.mk'... Updating makefiles.... Considering target file `/home/nic/test.mk'. Looking for an implicit rule for `/home/nic/test.mk'. No implicit rule found for `/home/nic/test.mk'. Finished prerequisites of target file `/home/nic/test.mk'. No need to remake target `/home/nic/test.mk'. Updating goal targets.... Considering target file `lib/.deps/test.fmc'. File `lib/.deps/test.fmc' does not exist. Looking for an implicit rule for `lib/.deps/test.fmc'. No implicit rule found for `lib/.deps/test.fmc'. Finished prerequisites of target file `lib/.deps/test.fmc'. Must remake target `lib/.deps/test.fmc'. make: *** No rule to make target `lib/.deps/test.fmc'. Stop. nic@nic-desktop:~$ --8<---------------cut here---------------end--------------->8--- Any hints on how to make pattern rules work with having targets and prerequisites within different (sub)directories? Thank you very much! Nicolai
.deps/%.fmc: %.f90 echo "$@ : $<"
_______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
