help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Environment Variable to Customize .INCLUDE_DIRS


From: Steven Simpson
Subject: Re: Environment Variable to Customize .INCLUDE_DIRS
Date: Sat, 23 Jan 2016 09:53:58 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 22/01/16 16:57, Afif Elghraoui wrote:
I know that i can also pass in a custom include path on the command line, but I would like to have some files with generic rules that I can include without any special command line invocation or hardcoding the absolute path.

I keep a bash function in ~/.bash_aliases to transform the value of $MAKEPATH into a series of -I switches:

function make_with_path () {
    local EXTRAS
    local index=1
    local copy="$MAKEPATH"
    local old
    while [ -n "$copy" ] ; do
        EXTRAS=("address@hidden" -I "${copy%%:*}")
        old="$copy"
        copy="${copy#*:}"
        if [ "$old" == "$copy" ] ; then break ; fi
    done
    `which make` "address@hidden" "$@"
}

alias make=make_with_path

It has been known to break some things occasionally, for which I have to unalias make.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]