title: How to set LDFLAGS for a "noinst" kind of library with Automake?
body: <p>Suppose I have developed <strong>libfoo.a</strong> as an intermediate step in my compilation process. Here is the line for it in Makefile.am:</p>
  
  <pre><code>noinst_LIBRARIES = libfoo.a
  </code></pre>
  
  <p>This lib depends on other libs. To prevent me from getting undefined reference errors, I need to setup its <strong>LDFLAGS</strong> variable. Here is what I did:</p>
  
  <pre><code>libfoo_a_LDFLAGS = `pkg-config --ldflags some_lib`
  </code></pre>
  
  <p>However, automake fails with this message:</p>
  
  <pre><code>variable `libfoo_a_LDFLAGS` is defined but no program or library has `libfoo_a` as canonical name (possible typo)
  </code></pre>
  
  <p>What am I doing wrong here? It works for <strong>libfoo_a_SOURCES</strong> and <strong>_CFLAGS</strong>.</p>