Where did you get this mess? This makefile was wrong long before you changed it for C ++ 11.
Let's start with the first line:
MACHINE = $(shell echo `uname -s`-`uname -m` | sed "s/ //g")
Try running the echo `uname -s`-`uname -m` and you will see that there are no spaces in it, so what's the point in the sed command?
Perhaps you want to:
MACHINE = $(shell uname -s -m | sed "s/ /-/g")
This only works for two processes (uname and sed), not four (two unames, echo and sed)
If you are using GNU make, this should be
MACHINE := $(shell uname -s -m | sed "s/ /-/g")
So, it starts only once.
CCC = CC
What is CC ?
CCC = g++
Oh, it doesn't matter, you replaced the value anyway. Plain make variable for C ++ CXX
CFLAGS = -O3 CFLAGS = -std=c++0x CFLAGS = -pg -D_DEBUG -g -c -Wall
As others have pointed out, you install CFLAGS, then install it on something else, and then on something else. Only the last value will be saved.
LFLAGS = -O LFLAGS = -pg -g
The same and what is LFLAGS ? Do you mean LDFLAGS ?
A good way to debug makefiles is to create a landing page for printing the variables you set to verify that they have the expected values:
print-vars: echo CFLAGS is $(CFLAGS) echo LDFLAGS is $(LDFLAGS)
Jonathan wakely
source share