URL: <https://savannah.gnu.org/bugs/?56732>
Summary: VPATH doesn't work with pattern rules Project: make Submitted by: None Submitted on: Thu 08 Aug 2019 11:26:35 AM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 4.2.1 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: VPATH doesn't work with pattern rules, at least when using link libraries. I can see nothing in the manual to suggest it shouldn't. Here's a reduced test case. Steps to reproduce: In an empty directory, create the following dirs/files: mkdir libs touch libs/libAbc.a mkdir input touch input/example.in touch input/example2.in mkdir output Create a Makefile with the following contents: VPATH = libs #irrelevant_recipe : -lAbc # echo "This recipe is never run" output/% : input/%.in -lAbc @echo "Running recipe to build $@ from $<" Run this command: make output/example Actual behaviour: > make output/example make: *** No rule to make target `output/example'. Stop. Expected behaviour: > make output/example Running recipe to build output/example from input/example.in Note: Uncommenting the "irrelevant" recipe causes the pattern rule to work in the above case. However, this workaround only works for one item - if you try to build example and example2 at the same time, it still fails to build whichever one comes second. But either can be built individually: > make output/example Running recipe to build output/example from input/example.in > make output/example2 Running recipe to build output/example2 from input/example2.in > make output/example output/example2 Running recipe to build output/example from input/example.in make: *** No rule to make target `output/example2'. Stop. This makes it not useful as a workaround, as really the point of pattern rules is to build multiple items using the same rule. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?56732> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make