title: Auto-install packages from inside makefile
body: <p>Goal: when the user types 'make packages', automatically search for the package libx11-dev (required for my program to compile) and, if not found, install it.  Here's a stripped-down version of my makefile: </p>
  
  <pre><code>PACKAGES = $(shell if [ -z $(dpkg -l | grep libx11-dev) ]; then sudo apt-get install libx11-dev; fi)
  
  [other definitions and targets]
  
  packages: $(PACKAGES)
  </code></pre>
  
  <p>When I type 'make packages', I'm prompted for the super-user password.  If entered correctly, it then hangs indefinitely.</p>
  
  <p>Is what I'm trying to do even possible from within the makefile?  If so, how?</p>
  
  <p>Thanks so much.</p>