Search code examples
makefilelibcurlnmake

$(MAKE) in makefile gets evaluated to make instead of nmake


I was trying to install libcurl libraries on my remote desktop following the steps mentioned in this post : How do you properly install libcurl for use in visual studio 2017?

But when I was running this command line nmake /f Makefile.vc mode=static , I was getting this error : make-3.80:*** No rule to make target '/NOLOGO'. Stop

This error was coming from this line in Makefile.vc :

@$(MAKE) /NOLOGO /F MakefileBuild.vc

After googling about the issue and going through the Visual studio documentation , I found that /NOLOGO is just an option , but somehow was being treated as a file (as can be seen from the above error).

So I tried to follow the same steps on my local machine , and I was able to install libcurl libraries. Then I tried to see what $(MAKE) evaluates to on my local machine and on my remote desktop and I found the following:

On my local machine , $MAKE is "C:\ProgramFiles(x86)\MicrosoftVisualStudio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"

On my remote desktop , $MAKE is make-3.80

Can anyone suggest as to what could be the issue here ? (In both cases I am running the same command using nmake )


Solution

  • According to the documentation, environment variables have precedence over built-in ones:

    If a macro has multiple definitions, NMAKE uses the highest-precedence definition. The following list shows the order of precedence, from highest to lowest:

    • A macro defined on the command line
    • A macro defined in a makefile or include file
    • An inherited environment-variable macro
    • A macro defined in the Tools.ini file
    • A predefined macro, such as CC and AS

    When MAKE environment variable is defined, it will take over built-in value.