mtm
mtm copied to clipboard
Use makefile variables in a more standard manner
In order to make mtm easier to compile on a variety of operating systems, let's use more standard makefile flags:
- Use CFLAGS for compiler flags.
- Use CPPFLAGS for preprocessor flags.
- Use LDFLAGS for linker flags.
- Deprecate LIBS in favor of LIBRARIES. It is better to avoid the use of LIBS for custom values as it is often used to store information for the linker.
- Deprecate LIBPATH. Use LDFLAGS to specify directories to search for libraries.
This way, for example, mtm can be compiled on FreeBSD with the following command:
env CFLAGS="-I/usr/local/include -I/usr/local/include/ncurses" \
LDFLAGS=-L/usr/local/lib \
make clean all
Also, I did not touch the HEADERS variable as I do not understand its purpose.
Using pkg-config would make it even easier.