title: makefile under freebsd does not compile (works on linux)
body: <p>I got the below makefile which works perfectly fine under linux as well as mac os. However it fails to do anything on <code>FreeBSD</code>, and I have no clue why. It gives the following output:</p>
  
  <pre><code>19:31:35 user@host:~/libhttp++/src&gt; make
  -
  Making HTTP++ library..
  make[1]: don't know how to make obj/libhttp++.a. Stop
  
  make[1]: stopped in /usr/home/user/libhttp++/src/obj
  *** Error code 2
  
  Stop.
  make: stopped in /usr/home/user/libhttp++/src
  </code></pre>
  
  <p>I also tried <code>gmake</code>, which gives the following output:</p>
  
  <pre><code>19:31:35 user@host:~/libhttp++/src&gt; gmake
  -
  Making HTTP++ library..
  Building Lib ...
  ar -rs obj/libhttp++.a obj/html.o  obj/http.o  obj/object.o
  ar: warning: creating obj/libhttp++.a
  ar: warning: can't open file: obj/html.o: No such file or directory
  ar: warning: can't open file: obj/http.o: No such file or directory
  ar: warning: can't open file: obj/object.o: No such file or directory
  ar: fatal: Failed to open 'obj/libhttp++.a'
  *** Error code 70
  
  Stop.
  make[1]: stopped in /usr/home/user/libhttp++/src
  gmake: *** [all] Error 1
  </code></pre>
  
  <p>One issue might be that i'm trying to keep all intermediate object files as well as the lib itself in a separate subdirectory ("obj").</p>
  
  <p>The problem is, I dont know much about makefiles, and the freebsd handbook as well as any example makefiles i could find via google did not help much. The makefile is basically copied from a working linux makefile I found somewhere, and well, it works on linux and mac os. Is there a way to convert it to a format which works on all 3 platforms? any help would be <strong>much</strong> appreciated.</p>
  
  <p><strong>makefile:</strong></p>
  
  <pre><code>#--------------------------------------------------------------------------
  # defines
  #--------------------------------------------------------------------------
  
  LIBDIR       = ../lib
  INCDIR       = ../include
  
  OBJDIR       = obj
  CXX          = g++
  doLib        = ar -rs
  doCompile    = $(CXX) $(CXXFLAGS)
  doLink       = $(CXX) $(LFLAGS)
  doClean      = rm -f *.o *~ *.a
  
  #--------------------------------------------------------------------------
  # Library
  #--------------------------------------------------------------------------
  
  OBJECTS = $(OBJDIR)/html.o \
            $(OBJDIR)/http.o \
            $(OBJDIR)/object.o
  
  LIBXMLPATH=~/Development/libxml2_2
  LIBCURLPATH=~/Development/libcurl
  
  #CDEF += -D__FORIOS__
  CXXFLAGS ?= -I ./ -I $(LIBXMLPATH)/include -I $(LIBCURLPATH)/include/curl $(CDEF) -c -ggdb -Wreturn-type -Wformat -pedantic -Wunused-variable -Wunused-label -Wunused-value -Wno-long-long
  
  DISTLIB = http++
  
  #--------------------------------------------------------------------------
  # compile lib objects
  #--------------------------------------------------------------------------
  
  lib:    all
  
  all:
      @(echo -; echo Making HTTP++ library..; make $(OBJDIR)/lib$(DISTLIB).a)
  
  $(OBJDIR)/lib$(DISTLIB).a: $(OBJECTS)
      @echo Building Lib ...
      $(doLib) $@ $(OBJECTS)
  
  clean:
      @(echo Cleanup HTTP++ library)
      $(doClean)
      (cd $(OBJDIR); $(doClean))
  
  install:
      @(echo Installing HTTP++ library in ../include ../lib)
      (mkdir -p $(LIBDIR); mkdir -p $(INCDIR))
      (cp -p *hpp *h $(INCDIR)/ ; cp -p $(OBJDIR)/lib$(DISTLIB).a $(LIBDIR)/)
  
  #--------------------------------------------------------------------------
  # Compiler Call
  #--------------------------------------------------------------------------
  
  $(OBJDIR)/%.o: %.cc
      @echo Compile "$(*F)" ...
      $(doCompile) $(*F).cc -o $@
  
  #--------------------------------------------------------------------------
  # dependencies
  #--------------------------------------------------------------------------
  
  CHECK = def.h
  
  $(OBJDIR)/html.o       : html.cc     $(CHECK) html.hpp
  $(OBJDIR)/http.o       : http.cc     $(CHECK) http.hpp
  $(OBJDIR)/object.o     : object.cc   $(CHECK) object.hp
  </code></pre>