title: Make file g++ shared library
body: <p>Im trying to create a library that i could integrate with R in the future, but also use on Command Line</p>
  
  <p>My first step in the path is creating a library, either .a or .so</p>
  
  <p>This is my make file. It compiles fine, but when i look at the folders are empty(Which means i cannot use it in my wilxtest.cpp</p>
  
  <pre><code>EXTERNALLIBS = -lnetcdf_c++ -lgsl -lgslcblas
  WILXAPP = src/wilxtest.cpp
  CXX = g++
  CXXFLAGS = -Wall -ggdb
  LIBOBJS: src/wilcoxonParallelTests.o
  LIBRARY: lib/WilcoxonParallelTests.a
  
  $(LIBRARY): $(LIBOBJS)
      $(CXX) $(CXXFLAGS) ar cr $(LIBRARY) $(LIBOBJS) $(EXTERNALLIBS)
  
  bin/Debug/WilxAstakTest: $(WILXAPP)
      $(CXX) $(CXXFLAGS) -o $@ $^ $(EXTERNALLIBS)
  
  Debug: $(LIBRARY) bin/Debug/WilxAstakTest
  
  MkDirs:
      mkdir -p obj
      mkdir -p lib
      mkdir -p bin/Debug
  
  cleanDebug:
      rm -rf obj/*
      rm -rf lib/*
      rm -rf bin/Debug/*
  </code></pre>
  
  <p><strong>EDITED:</strong></p>
  
  <p>I had ":" instead of "=" after LIBOBJS and LIBRARY. I also didnt have a target to create object file. Here is the updated version:</p>
  
  <pre><code>EXTERNALLIBS = -lnetcdf_c++ -lgsl -lgslcblas
  WILXAPP = src/wilxtest.cpp
  CXX = g++
  CXXFLAGS = -Wall -ggdb
  LIBCPP = src/wilcoxonParallelTests.cpp
  LIBOBJS = obj/wilcoxonParallelTests.o
  LIBRARY = lib/WilcoxonParallelTests.a
  
  $(LIBOBJS): $(LIBCPP)
      $(CXX) $(CXXFLAGS) -c $(LIBCPP) -o $(LIBOBJS)
  
  $(LIBRARY): $(LIBOBJS)
      ar -cr $(LIBRARY) $(LIBOBJS)
  
  bin/Debug/WilxAstakTest: $(WILXAPP) $(LIBRARY)
      $(CXX) $(CXXFLAGS) -o $@ $^ $(EXTERNALLIBS)
  
  Debug: $(LIBRARY) bin/Debug/WilxAstakTest
  
  MkDirs:
      mkdir -p obj
      mkdir -p lib
      mkdir -p bin/Debug
  
  cleanDebug:
      rm -rf obj/*
      rm -rf lib/*
      rm -rf bin/Debug/*
  </code></pre>