Pergunta

I need to use make-3.8.2 version for compiling code. I have modified makefile in following way.

export PATH := /home/make-3.82/bin:$(PATH)

I am able to change PATH variable But it Invoke current make version which is make-3.7.6.

if I set manually in terminal than it's work fine which is also correct as it takes from Path

So is it possible to override make file version or any init function where we can override make file version after running make command

In simple words, check make file version and if it's not set make file version 3.8.2 or report any error ( any option is fine)

My Purpose is, we can handle make file version inside Makefile rather than any .cshrc or .bashrc to avoid any enviroment setup

Foi útil?

Solução

I have doing following way in makefile.

ifneq ($(MAKE_VERSION), 3.82)
    $(error Please add /home/make-3.82/bin in PATH enviroment and re run)
endif

Outras dicas

If you set PATH from your makefile make already runs in the old version. I don't know under which OS/shell you are working. For bash you have to set your PATH var in ~/.bashrc.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top