<< 15/15
First Last

Target specific variables

  all: test1 test2 test3 test4
  
  A:=X
  B=X
  X:=foo
  
  test1: A+=$(X)
  test1:
  	@echo $(A)  # X bar
  
  test2: B+=$(X)
  test2:
  	@echo $(B)  # X bar
  
  test3: A:=
  test3: A+=$(X)
  test3:
  	@echo $(A)  # foo
  
  test4: B=
  test4: B+=$(X)
  test4:
  	@echo $(B)  # bar
  
  X:=bar