title: creating a makefile for 2 targets
body: <p>gcc 4.4.1
  C99</p>
  
  <p>I am creating a client server application.</p>
  
  <p>I have a Makefile that compiles all the files. However, I would like 2 create 2 targets (binaries) one called clt and svr. And would like the Makefile to create 2 separate directories for them, called ./client and ./server?</p>
  
  <p>So far I have done this to my Makefile. That only creates the svr. I am not sure how I can add the second target for the client to be created.</p>
  
  <p>Hope you understand my point?</p>
  
  <p>Many thanks for any suggestions,</p>
  
  <pre><code>OBJECT_FILES = server.o client.o cltsvr_ults.o
  
  CFLAGS = -ggdb -Wall -pthread
  
  LIBS = -lpthread
  
  CC = gcc
  
  svr: $(OBJECT_FILES)
      $(CC) $(CFLAGS) $(OBJECT_FILES) $(LIBS) -o svr
  
  client.o: client.c cltsvr_ults.h
      $(CC) -c client.c
  
  server.o: server.c cltsvr_ults.h
      $(CC) -c server.c
  
  cltsvr_ults.o: cltsvr_ults.c
      $(CC) -c cltsvr_ults.c
  
  clean:
      rm svr *.o *~
  </code></pre>