Advertisement
rockdrilla

GNU Make environment backpropagation / prerequisite feedback

Oct 2nd, 2014
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.95 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 $($(@)_PUSHBACK),$(eval $($(@)_PUSHBACK)))
  14.     $(if $($(@)_PUSHBACK),@echo $(c_rst) '>' $(c_t)$@$(c_rst)':' $(c_hack)$(@)_PUSHBACK = $($(@)_PUSHBACK)$(c_rst))
  15.     $(if $(LDFLAGS),@echo $(c_rst) '>' $(c_t)$@$(c_rst)':' $(c_hack)LDFLAGS = $(LDFLAGS)$(c_rst))
  16.     @echo $(c_rst) '>' $(c_t)$@$(c_rst)':'$(if $+, $(c_pr_n)$+)$(if $PIPE>,$(c_rst) '|' $(c_pr_o)$PIPE>)$(c_rst)
  17.  
  18. .DEFAULT: a
  19. a: b c | d e
  20. c: f
  21. d: g
  22. g: h/i.k
  23. h/i.k_PUSHBACK = LDFLAGS += -lz
  24.  
  25. ### output:
  26. # > b:
  27. # > f:
  28. # > c: f
  29. # > h/i.k: h/i.k_PUSHBACK = LDFLAGS += -lz
  30. # > h/i.k: LDFLAGS = -lz
  31. # > h/i.k:
  32. # > g: LDFLAGS = -lz
  33. # > g: h/i.k
  34. # > d: LDFLAGS = -lz
  35. # > d: g
  36. # > e: LDFLAGS = -lz
  37. # > e:
  38. # > a: LDFLAGS = -lz
  39. # > a: b c | d e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement