
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
None | size: 0.80 KB | hits: 9 | expires: Never
when multiple pattern rules match a target
$ touch make_specific.cpp
$ cat Makefile.general_first
%.o: %.cpp
@echo using general rule
$(CXX) -c $< -o $@
%_specific.o: %_specific.cpp
@echo using specific rule
$(CXX) -c $< -o $@
$ make -B -f Makefile.general_first make_specific.o
using general rule
g++44 -c make_specific.cpp -o make_specific.o
Version 3.82
...
* WARNING: Backward-incompatibility!
The pattern-specific variables and pattern rules are now applied in the
shortest stem first order instead of the definition order (variables
and rules with the same stem length are still applied in the definition
order). This produces the usually-desired behavior where more specific
patterns are preferred. To detect this feature search for 'shortest-stem'
in the .FEATURES special variable.