title: How to get the basename of the current folder as variable in a makefile?
body: <p>I want to copy a file to a server using <code>scp</code>. But I want to use my current folder name in my makefile as variable.</p>
  
  <p>I know I get my current path using <code>$(CURDIR)</code> but my local path isn't the same on my remote server.</p>
  
  <p>E.g. my path is <code>/Users/obstschale/Documents/Lab2/</code> and I want to copy Lab2.tar to <code>user@server.au:/home/path/Lab2/</code>.</p>
  
  <pre><code>copy2server:
      echo $(CURDIR)
      scp Lab2.tar user@server.au:/home/path/{folder}
  </code></pre>
  
  <p>I probably have to pipe <code>$(CURDIR)</code> into something and find my last folder.</p>
  
  <p>Update: <code>$(CURDIR)</code> is the right variable. <code>$(CURID)</code> is the wrong one at least it didn't work for me.</p>