title: Makefile using mixed versions of gcc
body: <p>I just installed gcc 4.8 via brew on my OSX (Snow Leopard) Machine.</p>
  
  <p>When I run make it uses the old version of g++ for the object file and the new version for the executable. </p>
  
  <pre><code>$ make
  g++    -c -o myprogram.o myprogram.cc
  g++-4.8 -g -Wall -o myprogram myprogram.o
  </code></pre>
  
  <p>I'm sure it is a simple thing in my Makefile, can anyone help me correct this?</p>
  
  <p>Makefile:</p>
  
  <pre><code>CC        := g++-4.8
  CFLAGS    := -g -Wall
  
  SRCS      := myprogram.cc
  OBJS      := ${SRCS:.cc=.o}
  TARGET    := ${SRCS:.cc=}
  
  default: all
  
  all: $(OBJS)
      $(CC) $(CFLAGS) -o $(TARGET) $(OBJS)
  </code></pre>
  
  <p>Here is the version info: </p>
  
  <pre><code>$ g++ --version
  i686-apple-darwin10-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
  Copyright (C) 2007 Free Software Foundation, Inc.
  
  $ g++-4.8 --version
  g++-4.8 (GCC) 4.8.1
  Copyright (C) 2013 Free Software Foundation, Inc.
  </code></pre>