richard
richard

Reputation: 1637

change PATH in makefile

my simple makefile

#export PATH=/xxx/bin:$$PATH

$(info $(PATH))

export ABC=123

t:
        echo $${PATH}

        echo $${ABC}

runs fine. until I uncommented the first line. following is output before and after before:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
echo ${PATH}
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
echo ${ABC}
123
echo 123
123

after:

/xxx/bin:$PATH
echo ${PATH}
/xxx/bin:$PATH
echo ${ABC}
123
echo 123
make: echo: Command not found
make: *** [t.mk:13: t] Error 127  

Upvotes: 1

Views: 1515

Answers (1)

HolyBlackCat
HolyBlackCat

Reputation: 96851

You want export PATH := /xxx/bin:$(PATH).

Upvotes: 4

Related Questions