Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.80 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. when multiple pattern rules match a target
  2. $ touch make_specific.cpp
  3.  
  4. $ cat Makefile.general_first
  5. %.o: %.cpp
  6. @echo using general rule
  7. $(CXX) -c $< -o $@
  8.  
  9. %_specific.o: %_specific.cpp
  10. @echo using specific rule
  11. $(CXX) -c $< -o $@
  12.  
  13. $ make -B -f Makefile.general_first make_specific.o
  14. using general rule
  15. g++44 -c make_specific.cpp -o make_specific.o
  16.        
  17. Version 3.82
  18. ...
  19. * WARNING: Backward-incompatibility!
  20.   The pattern-specific variables and pattern rules are now applied in the
  21.   shortest stem first order instead of the definition order (variables
  22.   and rules with the same stem length are still applied in the definition
  23.   order). This produces the usually-desired behavior where more specific
  24.   patterns are preferred. To detect this feature search for 'shortest-stem'
  25.   in the .FEATURES special variable.