Make install and environment variables

589 Views Asked by At

I started using linux a few months ago and some things are not yet clear to me. When executing the make install command, is it possible to set some variables for the user? For instance, when installing OGRE or CEGUI, are some variable like $OGRE_LIBS or $CEGUI_LIBS created? If so, how can you find the names attribute to such variables? (i mean if you are not sure of the given name)

If they are not set automatically: As, when installing such libraries, some filed are copied into /usr/local/share AND in /usr/local/include, I am not sure which variables I should set to which directory. Is there any convention for that?

In advance, thank you for your explanation,

Best,

Pierre A

1

There are 1 best solutions below

1
On BEST ANSWER

First of all Enviroment Variables has a constant name so that anyone can use them with no importance for the absolute path. the easiest way to check whether an envvar exists or not is using a helper bash/sh script. envar_checker.sh

#!/bin/bash

if [ -z ${envar+x} ] ; then
    echo ${envar} is not set!
    exit 1
fi
touch ./envar_exists

Makefile:

.envar_ok:
    ./envar_checker.sh

build: .envar_ok target1 target2

The advantage in this approach is that you will check the envvars only once!