Author Topic: Project Tools - path (no filename) %p and drive %v  (Read 2894 times)


  • Community Member
  • Posts: 12
  • Hero Points: 0
Project Tools - path (no filename) %p and drive %v
« on: February 08, 2007, 11:36:43 pm »
When I'm setting up my project build/etc tools, %p always includes the drive name (which seems odd since I could always use %v if I wanted the drive name).   For my environment, I need to supply my make/etc with:


and not with


Can I make %p do what I want?  Or do I need to write a macro (or modify HS2's macro in

(For anyone interested in why?, I want to use "plink ... make .. %p .." to remotely build on a linux box.  Linux doesn't understand my WinXP mapped L: drive is pointing to it's root.)


  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Project Tools - path (no filename) %p and drive %v
« Reply #1 on: February 09, 2007, 12:45:59 pm »
I afraid '%p' can't take care about your share mappings and refers to the local project anyway.
I'd propose the following to solve it:
Use a 'Open Project' macro (see Proj. Props->Open-Tab / attachment) to setup the plink (remote) project dir as an env.var, which can be used instead '%p'.

Code: [Select]
_command void set_plinkdir ()
   _str pd=_ProjectGet_WorkingDir (_ProjectHandle (_project_name));

   if ( pd != '' )
      pd=absolute (pd,strip_filename (_project_name,'N'));
      pd=strip_filename (pd,'D');

      // bslash -> slash
      pd = stranslate ( pd, "/", "\\", "" );

      // message ( "pd = " pd );
      set_env( "plinkdir",  pd );

Your Build command can look like this: plink ... make .. %(plinkdir) ..

Hope it works for you,