rockdrilla

hacking GNU Make once more

Oct 2nd, 2014
618
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.66 KB | None | 0 0
  1. #don't copy highlighted text, use 'raw paste data' textbox
  2. MAKEFLAGS +=--no-print-directory -Rr
  3.  
  4. c_t    = "\033[01;31m"
  5. c_pr_n = "\033[01;32m"
  6. c_pr_o = "\033[01;33m"
  7. c_hack = "\033[01;34m"
  8. c_rst  = "\033[00m"
  9.  
  10. T=a b c d e f g h/i.k
  11. .PHONY: $(T)
  12. $(T):
  13.     $(if $($(@)_ENV),@echo $(c_rst) '>' $(c_t)$@$(c_rst)':' $(c_hack)$($(@)_ENV)$(c_rst))
  14.     @echo $(c_rst) '>' $(c_t)$@$(c_rst)':'$(if $+, $(c_pr_n)$+)$(if $PIPE>,$(c_rst) '|' $(c_pr_o)$PIPE>)$(c_rst)
  15.  
  16. .DEFAULT: a
  17. a: b c | d e
  18. c: f
  19. d: g
  20. g: h/i.k
  21. h/i.k_ENV = hacked successfully
  22.  
  23. ### output:
  24. # > b:
  25. # > f:
  26. # > c: f
  27. # > h/i.k: hacked successfully
  28. # > h/i.k:
  29. # > g: h/i.k
  30. # > d: g
  31. # > e:
  32. # > a: b c | d e
Add Comment
Please, Sign In to add comment