#11 Build *.o files into separate directory

closed
nobody
None
5
2009-02-16
2009-02-09
No

Currently the object files are built into the same directory as the source files. So the directory is a kind of cluttered after a build.

I'd like to propose a patch to build the object files into a separate directory. The attached patch builds the object files into a directory called `objs`.

Discussion

  • Psychon
    Psychon
    2009-02-09

    Some comments on the patch:
    - You removed the 'mkdir .depend' call which means that gcc will error out, because that directory doesn't exist.
    - What is $(@F)? Oo

    Now, I would like to propose an alternative to you. autoconf offers something which is called out-of-tree builds AFAIK.
    Use it like this:
    (get the ZNC source)
    mkdir build ; cd build
    ../configure <whatever you like>

    configure and our Makefile will only create files in the build dir. The source dir can be read-only, if you feel like it. All objects code, Makefiles, etc. will be created in the build dir.

    Does this help you with your problem?

    If not, why is make clean not enough to get rid of that clutter?

    Marking this as pending, if you don't respond to this it will be marked as closed automatically in 2 weeks (?).

    psychon

     
  • Psychon
    Psychon
    2009-02-09

    • status: open --> pending
     
  • > - You removed the 'mkdir .depend' call which means that gcc will error
    > out, because that directory doesn't exist.

    No, it does not.

    > - What is $(@F)? Oo

    $@ would be objs/modules.o for example. F cuts the directory part and returns modules.o

    > Now, I would like to propose an alternative to you. autoconf offers
    > something which is called out-of-tree builds AFAIK.

    I'm gonna try that.

    > If not, why is make clean not enough to get rid of that clutter?

    I wouldn't mind if I'd just compile and install znc. But I'd like to play with the code, recompile it. So make clean is not an option.

     
    • status: pending --> open
     
  • Psychon
    Psychon
    2009-02-16

    • status: open --> closed
     
  • Psychon
    Psychon
    2009-02-16

    out-of-tree builds do what he wants (at least someone with nick sebastinas said so on IRC), closing