3 ms·
No; this is GNUmake specific syntax. The simplest and cleanest thing to do is to write a Makefile per uname(1).compiler, like so: Makefile.Linux.SunStudio
by Annatar 8y ago
No; this is GNUmake specific syntax.
The simplest and cleanest thing to do is to write a Makefile per uname(1).compiler, like so:
Makefile.Linux.SunStudio
Makefile.Linux.icc
Makefile.Linux.PGI
Makefile.Linux.GCC
Makefile.AmigaOS.vbcc
Makefile.AmigaOS.DiceC
Makefile.AtariTOS.gcc
Makefile.Spearmint.gcc
Makefile.illumos.gcc
Makefile.illumos.SunStudio
...and so on. The source code and generic targets like clean: would go into a central Makefile.core which would then be included by the OS.compiler specific Makefile. The OS specific Makefile would only set $CC, $CXX, $FC, $CFLAGS, $CXXFLAGS, $FFLAGS and so on.
This way, no configure system would be needed and adding support for a new $OS.compiler suite would be trivial.
The code would have to be so clean as to allow compilation by any compiler of course.