If you’ve exported the environment variable:
export demoPath=/usr/local/demo
you can simply refer to it by name in the makefile
(make
imports all the environment variables you have set):
DEMOPATH = ${demoPath} # Or $(demoPath) if you prefer.
If you’ve not exported the environment variable, it is not accessible until you do export it, or unless you pass it explicitly on the command line:
make DEMOPATH="${demoPath}" …
If you are using a C shell derivative, substitute setenv demoPath /usr/local/demo
for the export
command.
Related Posts:
- Meaning of “! -S” in shell script
- “No such file or directory” but it exists
- How do I split a string on a delimiter in Bash?
- Ubuntu says “bash: ./program Permission denied” [closed]
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Should I put #! (shebang) in Python scripts, and what form should it take?
- How do I copy a folder from remote to local using scp?
- How to concatenate string variables in Bash
- -bash: syntax error near unexpected token `)’
- An example of how to use getopts in bash
- How to delete from a text file, all lines that contain a specific string?
- How to mkdir only if a directory does not already exist?
- How do I iterate over a range of numbers defined by variables in Bash?
- How to set ssh timeout?
- commands not found on zsh
- sudo: apt-get: command not found
- How do I iterate over a range of numbers defined by variables in Bash?
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- How to mkdir only if a directory does not already exist?
- Using find to locate files that match one of multiple patterns
- “unary operator expected” error in Bash if condition
- What does “-ne” mean in bash?
- Is there a Python equivalent to the ‘which’ command
- How to generate random number in Bash?
- How to check if a variable is set in Bash?
- Who can access a file with octal permissions “000” on Linux/UNIX?
- How can I compare numbers in Bash?
- What does the line “#!/bin/sh” mean in a UNIX shell script?
- Open and write data to text file using Bash?
- How do I set a variable to the output of a command in Bash?
- python getoutput() equivalent in subprocess
- What is the $? (dollar question mark) variable in shell scripting?
- Is there a TRY CATCH command in Bash
- dquote> result of a execution a program in linux shell
- Using sudo with Python script
- how to fix the issue “Command /bin/sh failed with exit code 1” in iphone
- Run a string as a command within a Bash script
- conditional binary operator expected in shell script
- Block Comments in a Shell Script
- What are the uses of the exec command in shell scripts?
- using rot13 and tr command for having an encrypted email address
- Shell Script: Execute a python program from within a shell script
- sed whole word search and replace
- What’s the difference betwen the single dash and double dash flags on shell commands?
- How to let ‘cp’ command don’t fire an error when source file does not exist?
- What is a reverse shell?
- How do I pause my shell script for a second before continuing?
- In the shell, what does ” 2>&1 ” mean?
- Where to place $PATH variable assertions in zsh?
- gcc makefile error: “No rule to make target …”
- How do I use a regex in a shell script?
- gcc makefile error: “No rule to make target …”
- Multi-line string with extra space (preserved indentation)
- How to perform grep operation on all files in a directory?
- Loop through an array of strings in Bash?
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- OS X: equivalent of Linux’s wget
- How to substitute shell variables in complex text files
- OS X: equivalent of Linux’s wget
- How to install “make” in ubuntu?
- How can I declare and use Boolean variables in a shell script?
- How to exclude a directory in find . command
- How to reload .bash_profile from the command line?
- Replace one substring for another string in shell script
- “[ ]” vs. “[[ ]]” in Bash shell
- Pseudo-terminal will not be allocated because stdin is not a terminal
- how to “execute” make file
- How do I force make/GCC to show me the commands?
- Elegant way to search for UTF-8 files with BOM?
- Given two directory trees, how can I find out which files differ by content?
- Diff command along with Grep gives “Binary file (standard input) matches”
- Makefile:2: *** missing separator. Stop
- find: missing argument to -exec
- Make error: missing separator
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- What are Makefile.am and Makefile.in?
- Is there a “goto” statement in bash?
- Compiling C++ on remote Linux machine – “clock skew detected” warning
- How to use su command over adb shell?
- Badly placed ()’s error with the following shell script
- Command to change the default home directory of a user
- g++ output: file not recognized: File format not recognized
- makefile “no such file or directory”
- What does “&” at the end of a linux command mean?
- Syntax error near unexpected token ‘then’
- The difference between .mk file and Makefile
- File format not recognized; treating as linker script using GCC
- Shell script not running, command not found
- How to use ADB Shell when Multiple Devices are connected? Fails with “error: more than one device and emulator”
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- Makefile on Cygwin
- Can pm2 run an ‘npm start’ script
- Integer expression expected error in shell script
- What does “all” stand for in a makefile?
- What is the difference between double and single square brackets in bash?
- What does ‘set -e’ do, and why might it be considered dangerous?
- How to add a timestamp to bash script log?
- How can I kill all stopped jobs?
- Adding a directory to $PATH in CentOS?