CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    48

    Customizing exe search PATH inside makefile

    Hello,

    Is it possible to modify or customize binaries search path y a nmake command or macro?

    Assuming I have a system general PATH and I want nmake to lookup CL.exe in different directory than in the system wide PATH string...
    Thx

  2. #2
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: Customizing exe search PATH inside makefile

    Not sure if you can do it inside the make file, however you could create a batch file that changes the PATH and then calls nmake.

    It would look something like this:
    Code:
    set path=%PATH%;C:\myspecialpath1;d:\anotherdir\myspecialpath2
    nmake ....
    That would append your paths to the existing path variable, and applies as long as you're within that command window.

    Hope that helps.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  3. #3
    Join Date
    Feb 2009
    Posts
    48

    Re: Customizing exe search PATH inside makefile

    and is is possible to call that bath file from inside makefile?

    app.exe : $(OBJS)
    call changeoath.bat
    cl.exe "$@" $<

  4. #4
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Customizing exe search PATH inside makefile

    Quote Originally Posted by krmed View Post
    Code:
    set path=%PATH%;C:\myspecialpath1;d:\anotherdir\myspecialpath2
    Hint: If you want to override .exe files that are already present in the current search path, you should prepend your additional directories to the path since it is searched from fromt to back. The command to do that would then look like this:

    Code:
    set path=C:\myspecialpath1;d:\anotherdir\myspecialpath2;%PATH%
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  5. #5
    Join Date
    Feb 2009
    Posts
    48

    Re: Customizing exe search PATH inside makefile

    Okay thx

    so
    writing

    PATH=c:\myvcdir;d:\mytolsdir;$(PATH)

    has no effect?




    One more thing I struggle, how to terminate lines that have to end with '\' token,
    e.g.

    ICLInstDir = D:\develop\CPP\bin\

    would instruct nmake to merge with following line as \ token is taken as line continuor, silly
    Could it be prefixed with a special char that instructs nmake to take \ literally, not a control character?

  6. #6
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Customizing exe search PATH inside makefile

    Quote Originally Posted by Anakunda View Post
    so
    writing

    PATH=c:\myvcdir;d:\mytolsdir;$(PATH)

    has no effect?
    At least not in a batch file. I'm not really familiar with the makefile syntax though...
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured