I found this port = ${PORT}
in one makefile. How can I pass value to the variable port
using make commands?
Asked
Active
Viewed 190 times
1 Answers
2
for many simple situations, pass the values on the command line using the variable=value grammar. Note that this will (usually) override the value in the Makefile.
make PORT=1234 ...
# OR
make port=1234 ...
This format will also override other variable settings (environment variables, built-in variables, ...). It will NOT replace variables set with the 'override' directive.
@rveerd comment provide a link to more complete answer.

dash-o
- 13,723
- 1
- 10
- 37
-
1Note that these are two separate variables. In this particular example `port` gets copied from the uppercase `PORT` within the Makefile as per the code the OP posted, so both will work. – tripleee Sep 29 '19 at 10:21