Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What ${CC} means in makefile?

Tags:

makefile

cc

I have makefile that uses ${CC} variable for compiler selection:

${CC} $(CFLAGS) aaa.cpp -o aaa.o

During make ${CC} brings cc compiler. But there is no definition of ${CC} in whole makefile. How this variable gets cc?

like image 540
vico Avatar asked Nov 01 '25 20:11

vico


1 Answers

Some of the variables make uses in its implicit rules like CC have default values.

You can read more about them in the GNU make documentation about variables used in implicit rules:

In general variables can also get their value through the environment or by passing command line arguments to make, as well as other ways for some special variables as documented here.

like image 166
PaulR Avatar answered Nov 04 '25 21:11

PaulR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!