How to set child process' environment variable in Makefile

前端 未结 4 1702
半阙折子戏
半阙折子戏 2020-11-28 05:08

I would like to change this Makefile:

SHELL := /bin/bash
PATH  := node_modules/.bin:$(PATH)

boot:
    @supervisor         \\
      --harmony         \\
             


        
4条回答
  •  鱼传尺愫
    2020-11-28 05:18

    Make variables are not exported into the environment of processes make invokes... by default. However you can use make's export to force them to do so. Change:

    test: NODE_ENV = test
    

    to this:

    test: export NODE_ENV = test
    

    (assuming you have a sufficiently modern version of GNU make >= 3.77 ).

提交回复
热议问题