c++ - CFLAGS not recognised in makefile -
i'm complicating small school assignment uses lambda functions, needs '-std=c++11' in gcc call. output of make file seems show not being added. i'm not having linking problems there no need copy source here.
here makefile:
cc=g++ cflags= -std=c++11 -i. -wall deps = wordarray.h obj = ayalajl03b.o wordarray.o %.o: %.c $(deps) $(cc) -c -o $@ $< $(cflags) l03b.out: $(obj) $(cc) -o $@ $^ $(cflags) .phony: clean clean: rm -f -v *.o rm -f -v *.out
here output:
[user@server lab03]$ make g++ -c -o wordarray.o wordarray.cpp wordarray.cpp:28:77: warning: lambda expressions available -std=c++11 or =gnu++11 counter([](char a)->bool{return !isvowel(a) && !isdigit(a) && isalpha(a);}, worount].word);
please me understand i'm doing wrong.
your rule
%.o: %.c $(deps)
but compiling .cpp
file.
the implicit make
rule .cpp
source files used.
either change rule
%.o: %.cpp $(deps)
or set cxxflags
variable used in implicit rule.
Comments
Post a Comment