title: Multiple programs share a source file when autotools generating makefiles
body: <p>This question concerns mostly Unix/Linux style C development. I am using <code>autotools</code> to generate <code>Makefile</code>.</p>
  
  <p>There are two programs share a source file named <code>utils.c</code>. </p>
  
  <p>The structure of my source tree goes like this:</p>
  
  <pre><code>app/
      src/
          server/
              server.c
              ...
          client/
              client.c
              ...
      include/
  </code></pre>
  
  <p>The question is where should I put the shared source file and how should I write my <code>Makefile.am</code> or <code>configure.ac</code> to make it work. </p>
  
  <p>The current <code>configure.ac</code> only specify the <code>AC_CONFIG_FILES([Makefile src/Makefile])</code></p>
  
  <p>And the current <code>src/Makefile.am</code> goes like this:</p>
  
  <pre><code>bin_PROGRAMS = server client
  server_SOURCES = server/server.c
  client_SOURCES = client/client.c
  server_LDADD = $(DONT_KNOW_WHAT_TO_WRITE)
  client_LDADD = $(DONT_KNOW_WHAT_TO_WRITE)
  </code></pre>
  
  <p>Thanks.</p>