Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use makefile variables in a more standard manner #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0mp
Copy link

@0mp 0mp commented Aug 6, 2019

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.

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.
@JohnAZoidberg
Copy link

Using pkg-config would make it even easier.

Copy link

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but needs to be rebased.

Note, loosely related merge/pull request #45 has also been submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants