I have a set of C programs that are generally compiled using gcc in a makefile, but OSX Mavericks now uses clang. What is a good way to test for existing compilers in a makefile and use the appropriate one? Moreover, I would also like to use architecture-dependent optimization flags (e.g., for gcc on Linux, I would use -O3, but on OSX I would use -fast; for clang on OSX I would use -Ofast).
Kindest thanks,
Ryan