github.com/westcoastroms/westcoastroms-build@v0.0.0-20190928114312-2350e5a73030/build/kati/testcase/multiline_recipe.mk (about)

     1  # TODO(c): fix test6 - \t$${empty} should be empty.
     2  MAKEVER:=$(shell make --version | ruby -n0e 'puts $$_[/Make (\d)/,1]')
     3  ifeq ($(MAKEVER),4)
     4  AT=@
     5  endif
     6  
     7  # http://www.gnu.org/software/make/manual/make.html#Splitting-Recipe-Lines
     8  test1:
     9  	$(AT) echo no\
    10  space
    11  	$(AT) # echo no\
    12  	# space
    13  	$(AT) echo one \
    14  	space
    15  	$(AT) echo one\
    16  	 space
    17  
    18  test2:
    19  	$(AT) for d in foo bar; do \
    20  	  echo $$d ; done
    21  
    22  define cmd3
    23  echo foo
    24  echo bar
    25  endef
    26  
    27  test3:
    28  	$(cmd3)
    29  
    30  define cmd4
    31  echo foo ; \
    32  echo bar
    33  endef
    34  
    35  test4:
    36  	$(cmd4)
    37  
    38  test5:
    39  	$(AT) echo foo \
    40  	$$empty bar
    41  
    42  test6:
    43  	echo foo\
    44  	$${empty}bar
    45  
    46  define cmd7
    47  @echo first
    48  @echo second
    49  endef
    50  
    51  test7:
    52  	$(cmd7) \
    53  	 third
    54