User forums > Using Code::Blocks

Makefile execution directory

(1/1)

gbr:
Hi,

I'm moving some Makefile projects into Code::Blocks.  My directory structure is:


[dir]src
     [sub dir 1]project (contains source)
          [sub dir 2]makefile_dir


All of my source is in src/project, and my Makefile is in src/project/makefile_dir.  I can get Code::Blocks to use the proper Makefile, but it seems to want to execute it from the src/project directory rather than the src/project/makefile_dir directory.  Because of this, all the references in the Makefile to my source code are wrong.  The Makefile points to all source code as ../, which is correct since the Makefile is in a subdir.  But it's wrong for where Code::Blocks executes the Makefile.

I hope that's clear enough. 

My question is, can I make Code::Block chdir to makefile_dir before executing make?

Thanks,
Gerald

gbr:


I went into Project->Build Options->Makefile and added 'cd dir;' in front of the makefile.

Gerald

Navigation

[0] Message Index

Go to full version