Author Topic: Compile single file with custum makefile  (Read 3643 times)

Greg84

  • Guest
Compile single file with custum makefile
« on: July 20, 2009, 11:35:37 am »
Hello,
I'm using C::B 8.02. I wonder if it is possible to change the value of the $file variable in the "Make" Commands tab (Project Build Options). In fact, this variable represents the full name of the file to build depending on the target : for example "obj/Debug/foo.o" if the target is Debug. So the make command executed is "make -f Makefile obj/Debug/foo.o". I use custum makefile and I'd like to compile single file with "make -f Makefile foo.o". A solution would be inserting the shell command "basename" in order to execute this
:
Code
make -f Makefile $(basename obj/Debug/foo.o)

If I write this in "Make commands tab in C::B  :

Code
$make -f $makefile $(basename $file)

It mistakes the shell syntax $() for its own variable syntax and executes make as :

Code
make -f Makefile $(basename 


which of course results in errors "no target to build...."

My makefile has "Debug" and "Release" target so I can't use blank target. What can I do ?

Thanks ^^