Author Topic: Script that modifies the Makefile variable based on projectdir variable  (Read 2364 times)

Offline Bonanza

  • Multiple posting newcomer
  • *
  • Posts: 34
  • Engineer
Hi folks,

I am hoping for a little help on scripting something I am coking on.

I am working on colinux(ubuntu) but I prefer to run codeblocks from windows accessing the files in a samba driver and building with plink + gcc make.

As I am a release responsible I need to have more svn working copies at the same time, and as I have multible build targets I need somehow to specify to plink where to make for all the target of the particular workingcopy for which a cbp file is opened. This I have done using the Project-properties $makefile variable.

My Build options-> "make" commands look something like this:
target1:
Code
plink -l user -pw user ubuntu make target1 -C $makefile  

target2:
Code
plink -l user -pw user ubuntu make target2 -C $makefile 

etc...

This way I only need to set the $makefile variable in the properties to something like: /home/user/workingcopy1/ right after I open the the cbp file of the particular project.

and for anther working copy something like: /home/user/workingcopy2/.

When I open the cbp file it is opened from z:\workingcopy1 (samba) so in this case I need to manually set the $makefile to /home/user/workingcopy1/ before I build.

-----

What I would like some script to do is that either upon load of a project or before build to somehow set the $makefile variable to the linux path(/home/user/workingcopy1/) extacted from the $projectpath(z:\workingcopy1). So i guess it also contains a little regular expression replace.

But I am on prety much clueless on how to get started on this so a few good hints form some scripting experts would really be great.

Thanks Flemming