dimanche 1 février 2015

Makefile seems to ignore flags. Why?

It seems like make is ignoring my cflag options, as the compiler complains that I need to have -std=c++11 as a flag, but that option is included in my makefile.



CC=g++
# Flags for the C compiler
CC_FLAGS= \
-Wall \
-std=c++11 \
-O2
# Linker Flags
LD_FLAGS=

# Sources to compile
SOURCES=main.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXE=HolidayLights.out

all: $(SOURCES) $(EXE)

# Primary build target
$(EXE): $(OBJECTS)
$(CC) $(LD_FLAGS) $(OBJECTS) -o $@

.o:
$(CC) -c $(CC_FLAGS) -o $@ $<


The output of the build commands of this makefile are:



g++ -c -o main.o main.cpp


I don't understand why it's not listing my flags in the output. Also, I know for a fact that it is ignoring -std=c++11 flag as it complains about non-static constant member, and it shouldn't with that flag enabled.


Aucun commentaire:

Enregistrer un commentaire