Exporting environment variables to Makefile shell

后端 未结 5 1496
梦毁少年i
梦毁少年i 2021-01-04 18:01

I want to do immediate expansion of a shell command within a Makefile, but I want the shell command to have access to the environment variables within the Makefile. If I us

5条回答
  •  余生分开走
    2021-01-04 18:27

    You may try to use Special Built-in Target Name: .EXPORT_ALL_VARIABLES

    .EXPORT_ALL_VARIABLES:
    
    MY_VAR = foo
    
    test:
      @echo $$MY_VAR
    

提交回复
热议问题