Code Snippet:
target_test : test.cc
$(CXX) $(CPPFLAGS) $(CFLAGS) test.cc
I know that CXX is a variable (containing the compiler command to call), but I was wondering where this variable comes from. The variable is not defined in the makefile and is not an environment variable. Can anyone explain where the value of CXX comes from?
Make has several predefined variables among which is
CC. Initially, it is set atccwhich is a symlink to the installed C compiler:Also:
You can change it if you want.
You can use
make -p -f /dev/nullto get a list of all implicit rules and variables. I cannot show the output right now because I have a non-standard install and the output is not in English.