title: Using makefile variable on subdirectory .sh?
body: <p>Is it possible to use variables defined in a .mk file and use them in a .sh file?</p>
  <p>In this case, there's a general makefile that includes a .mk file which defines directories that will be used in all of the submakes. This is done with the export command, if I'm not mistaken. An example:</p>
  <pre><code>export SW_DIR:=$(ROOT_DIR)/software
  </code></pre>
  <p>In all of the submakes, I can call this folder using $(SW_DIR), but what about in .sh files? I'm having trouble doing the exact same thing on bash scripts. Is it possible to carry over the environment variable from a makefile to a bash script?</p>
  <p>In the main Makefile, the first lines are:</p>
  <pre><code>export ROOT_DIR:=.
  include ./system.mk
  </code></pre>
  <p>Then in the system.mk, there's:</p>
  <pre><code>export SW_DIR:=$(ROOT_DIR)/software
  export PYTHON_DIR:=$(SW_DIR)/python
  </code></pre>
  <p>And further in, in the .sh file which is in a sub-directory, I call:</p>
  <pre><code>cp ${SW_DIR}/file.h .
  ${PYTHON_DIR}/code.py ADDRESS &gt; ADDRESS
  </code></pre>