Instead of hardcoding "gcc", this allows the user to set the compiler with the typical CC environment variable, such as:
make CC=/path/to/my/clang
I initially also added a line CC=gcc at the top so as to not change the previous behavior. However make already provides a default value of "cc" for CC which is usually fine, since cc should be whatever the customary compiler is on a system. On macOS, since over a decade now, /usr/bin/gcc has not been gcc but rather a wrapper that calls clang (just as /usr/bin/cc does) and with which c2t appears to build fine. In fact, when building your macos targets, your Makefile doesn't even work with real gcc:
Instead of hardcoding "gcc", this allows the user to set the compiler with the typical CC environment variable, such as:
I initially also added a line
CC=gcc
at the top so as to not change the previous behavior. Howevermake
already provides a default value of "cc" for CC which is usually fine, sincecc
should be whatever the customary compiler is on a system. On macOS, since over a decade now, /usr/bin/gcc has not been gcc but rather a wrapper that calls clang (just as /usr/bin/cc does) and with which c2t appears to build fine. In fact, when building your macos targets, your Makefile doesn't even work with real gcc:For these reasons I felt that using
make
's default value ofCC=cc
was the way to go.