mtm icon indicating copy to clipboard operation
mtm copied to clipboard

Use makefile variables in a more standard manner

Open 0mp opened this issue 6 years ago • 1 comments

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.

0mp avatar Aug 06 '19 14:08 0mp

Using pkg-config would make it even easier.

JohnAZoidberg avatar Aug 08 '19 15:08 JohnAZoidberg