title: How do you set the order of libraries in automake?
body: <p>How do you set the order of libraries in automake?</p>
  
  <p>In my am file I have something like:</p>
  
  <pre><code>myprog_DEPENDENCIES = adhoc-target
  myprog_SOURCES = myprog.c
  myprog_LDADD = libmine.la
  myprog_LDFLAGS = -static -L/home/user/lib -ladhoc
  </code></pre>
  
  <p>Now, when I compile I get this compile line similar too:</p>
  
  <pre><code>gcc -static myprog-myprog.o -o myprog -L/home/user/lib -ladhoc ./.libs/libmine.a
  </code></pre>
  
  <p>The problem is that libmine.a depends on libadhoc.a, therefore the compile line should be:</p>
  
  <pre><code>gcc -static myprog-myprog.o -o myprog ./.libs/libmine.a -L/home/user/lib -ladhoc
  </code></pre>
  
  <p>How do you set the order of libraries in automake? (Or maybe a work around; how do you repeat all the libraries in the compile line. That's what I do in my custom Makefiles.)</p>