How to set environment variables in Makefile
How to set the child process environment variable in Makefile
I want to change this makefile:
Unfortunately, the second one doesn't work (the node process will still run with the default setting.
What have I missed?
By default, make variables are not exported to the environment of processes. However, you can use make to force them to do so. Change:
(assuming you have a sufficiently modern version of GNU make> = 3.77).
As MadScientist pointed out, you can export individual variables with:
Or export variables for a specific target (target-specific variables):
You can also specify the destination to - you guessed it! - EXPORT ALL THINGS !!!:
I only needed the environment variables locally to invoke my test command. Here is an example where multiple environment variables are set in a bash shell and the dollar login escaped.
I would rewrite the original target test, making sure that the required variable is defined IN THE SAME SUB-PROCESS as the application to start:
- Is Amrita University better than SRM
- What is 1 1 64
- Under what conditions does a nuclear fusion take place?
- Trained people in the Stone Age
- Why is the word Jap considered racist
- What is the network automation market
- Has a startup succeeded without start-up capital
- How do I delete Internet Explorer
- What is your country's greatest contribution to humanity
- Arbitration means an agreement
- How are arsonists treated in prison?
- What is the pattern of JPSC
- Why are young trees planted with stakes
- Are the rights of states still relevant today?
- Should I sell these steam tickets
- Is it worth learning NoSQL in 2020
- Without river water, the ocean is possible
- What is the best size iPhone
- Why should AstroTurf artificial turf have to be watered
- Why do parents tolerate choosy eaters
- What are the fluctuations in the speed of life
- 5 3 is a good amount
- How do boomerangs work in physics
- How can we improve app development skills