title: What is wrong with this Makefile
body: <p>I have the following makefile. If I do <code>make USE_44=1 USE_O=1</code> for example, I receive the following error.</p>
  
  <p><code>makefile:21: *** missing separator</code>, where line 21 is <code>elif ($(USE_S), 1)</code>. </p>
  
  <p>Note that if I do <code>make USE_44=1</code>, it compiles fine.</p>
  
  <p>Can someone tell me what is the problem here and how can I fix it?</p>
  
  <pre><code>USE_44 = 0
  USE_IO = 0
  USE_O = 0
  USE_S = 0
  USE_F = 0
  USE_I = 0
  USE_WL = 0
  
  ifeq ($(USE_44), 0)
      CXX = g++
  else
      CXX = g++44
  endif
  
  CXXFILES = main.cpp jacobcalc.cpp linkup.cpp slave1.cpp jacobcalc2.cpp slave2.cpp laplacalc.cpp multi.cpp subblock.cpp replication.cpp hash.cpp
  
  CXXFLAGS := -std=c++0x -O3 -o
  
  ifeq ($(USE_O), 1)
      CXXFLAGS += progo -DWITHOUT_LOCKS -DWITHOUT_BARRIERS -DWITHOUT_MPROTECT 
  elif ($(USE_S), 1)
      CXXFLAGS += progs -DWITHOUT_LOCKS -DWITHOUT_BARRIERS -DWITHOUT_MPROTECT -DSINGLE
  elif ($(USE_F), 1)
      CXXFLAGS += progf -DNEGLECT_DET_LOCKS 
  elif ($(USE_I), 1)
      CXXFLAGS += progi -DWITH_INSTR
  elif ($(USE_WL), 1)
      CXXFLAGS += progwl -DWITHOUT_LOCKS 
  else
      CXXFLAGS += prog
  endif
  
  ifeq ($(USE_IO), 1)
      CXXFLAGS += -DWITHOUT_IO
  endif
  
  #CFLAGS := $(CFLAGS) -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization
  #CFLAGS := $(CFLAGS) -Wpadded -Winline -Wpointer-arith -Wsign-compare -Wendif-labels prog
  LIBS := -lm -lpthread 
  
  all:
      $(CXX) $(CXXFILES) $(LIBS) $(CXXFLAGS)
  
  clean:
      rm -f prog* *.o
  </code></pre>