Author Topic: Multiple makefile  (Read 3743 times)

Harbaingan

  • Guest
Multiple makefile
« on: December 13, 2006, 07:20:09 pm »
Hello, first message from me,

It's about multiple makefiles in one project. So let me introduce the project structure :

Quote
|
| - product
    | - inc
        | a.h
        | b.h
    | - mkgen
        | makefile   
    | - productA
        | - inc
            | a-c.h
            | a-d.h
        | - mkgen
            | makefile
        | - src
            | -  stuffA1
                | - src
                    | stuffA1.c
                | - inc
                    | stuffA1.h
                | - mkgen
                    | makefile
            | -  stuffA2
            | -  stuffA3
    | - productB
        | - inc
        | - src
        | - mkgen
    | - productC

I have diffrent level of makefile in the project. So if i change only StuffA1, i want to make the makefile in StuffA1 directory. And if i change different class and file, i will make the makefile at the top of the structure.

Then all my makefile are written in the same way :

Quote
target all, debug, clean, prepare

Then if i want to compile StuffA1 only, i right click on the file in the left tree of C::B, then Compile. But in my makefiles, the path are related to the make file (e.g. : cd /product/productA/mkgen, make all)

So these are my questions:

1 : How can i manage all those makefiles in my project with C::B ?
2 : How can i manage to have the correct path (makefile path) when i build one file ?

Thank for your attention and don't hesitate to ask details if you have to.

Regards.




Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Multiple makefile
« Reply #1 on: December 13, 2006, 08:50:02 pm »
That is a typical setup with more flexible build system like cmake and scons.  The difference between them and this setup is you don't have to manually go into a subdirectory when you want to build that directory, just building from the top will only build the few files that changed (well depending on how there dependencies are structured).  If you must call each makefile directly I think you are going to need a project for each makefile and a workspace to combine them all.  Really this is a dependency tracking issue, you should just be able make from the root of project and have only what needs to be build built.