title: How to compile the multithread code with gcc
body: <p>I have seen the given two makefiles as follows:</p>
  
  <pre><code>all: thread1 thread2 thread3
  
  CFLAGS=-I/usr/include/nptl -D_REENTRANT
  LDFLAGS=-L/usr/lib/nptl -lpthread
  
  clean:
      rm -f thread1 thread2 thread3
  
  ######################
  
  all: thread1 thread2 thread3
  
  CFLAGS=-D_REENTRANT
  LDFLAGS=-lpthread
  
  clean:
      rm -f thread1 thread2 thread3
  </code></pre>
  
  <p>Without using makefile, what is the correct command line to compile the thread1.c with gcc?</p>
  
  <blockquote>
    <p>gcc -o thread1
    CFLAGS=-I/usr/include/nptl
    -D_REENTRANT LDFLAGS=-L/usr/lib/nptl -lpthread thread1.c</p>
  </blockquote>