Re: git build failure with libssl (OpenSSL) in custom directory
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 18, 2010, 18:24 UTC
- Message-ID
- <20101118182447.GF16610@burratino>
- In-Reply-To
- <AANLkTikZBcmbFoCmqT-eorGm3R0YYjkzotc414w_PHyd@mail.gmail.com>
Lars Buitinck wrote:
> Yes, that works fine with LDFLAGS= in the Makefile. Is this just a > lack of Makefile-fu on my part?
In general, "make" likes to get its variable assignments on the command line rather than from the environment. This way, Makefile authors do not have to worry about keeping variable names in a tightly reined namespace.
On the other hand, it can be convenient to set up the environment with flags that would be used for multiple builds. Different projects deal with that differently:
./configure takes certain values (including LDFLAGS) from the environment in autotools-using projects. ./configure --help=short lists them.
The Linux kernel build system has a separate (namespaced) set of variables it reads from the environment. Example: exporting KBUILD_OUTPUT=$HOME/.cache/linux-2.6 in .profile would save me from typing "make O=$HOME/.cache/linux-2.6" every time I build the kernel. They are documented in Documentation/kbuild/kbuild.txt.
Git reads settings from a config.mak file in the toplevel of the git source tree. So one can set
LDFLAGS = -L$(HOME)/opt/git/lib
there and it will be used for all builds.