Your main
rule requires timer.o
. There is no explicit rule for timer.o
so make uses a built in implicit rule (as mentioned in the comment at the end of your makefile). The implicit rule for converting .cpp
files into .o
files has the form
$(CPP) $(CPPFLAGS) -c $<
So it's compiling using the options in CPPFLAGS
which contains -Xcompiler
. You probably want the -Xcompiler
flag to be in NVCCFLAGS
and not CPPFLAGS
.