Author Topic: Custom Makefiles and paths  (Read 5059 times)

johnl

  • Guest
Custom Makefiles and paths
« on: October 31, 2005, 11:47:56 pm »
I have existing source code files and project/makefiles and simply want to use codeblocks as an editor that when I press "compile" it runs a command of my choice and should there be any warnings/errors I can click on them in the "compiler output" window and the appropriate file opens to be edited.

I do *NOT* want CodeBlocks to generate ANY files other than it's project file. (currently it's created a "msvc" dir in the root dir of the project for some bizarre reason)

So... I created a new project with Project->New Empty Project and recursively added my source files. I edit the project properties using Project->Properties and select "this is a custom Makefile". I'm trying out the free VC++ 2003 compiler so I edit the "Build Options" and select that.

The problem is that my project's directory structure is like that of wxWidgets, where my build files are in a directory alongside that of the source code.

wxstedit
    src/*.cpp
    include/wx/stedit/*.h
    build/makefile*
    samples/stedit/sample.cpp

When I press "Build" it runs (I assume?) nmake -f "whatever I entered in Project->Properties" BUT! apparently it runs it in the directory where the project file is located. eg. I must use "build\makefile.vc" for it to find the makefile.

1) Can the build window be made to print the CWD and what commands are run, I think it would help in debugging and just generally be informative without taking up too much space or confuse people.

2) I need to have Codeblocks change the CWD to the build dir before running nmake to get the paths correct of both the makefile and of the sourcefiles in the makefile.  (Build options->Commands->Prebuild steps "cd /.../wxstedit/build" doesn't seem to get run)

3) I also need to specify what and where the output executable will be generated by the makefile (samples/stedit/wxstedit.exe) so that if I press "Run" it'll know what to do.

Is there any way to do all this? Basically I'm probably just asking if Codeblocks can be dumbed down so that it just follows the users whim.

Thanks for what looks to be a very nice editor,
    John Labenski