Author Topic: Makefile execution directory  (Read 3386 times)

Offline gbr

  • Single posting newcomer
  • *
  • Posts: 4
Makefile execution directory
« on: November 21, 2008, 07:33:31 pm »
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

Offline gbr

  • Single posting newcomer
  • *
  • Posts: 4
[SOLVED] Makefile execution directory
« Reply #1 on: November 21, 2008, 08:35:51 pm »


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

Gerald