Makefile - How to save the .o one directory up?

Posted by nunos on Stack Overflow See other posts from Stack Overflow or by nunos
Published on 2010-04-10T22:03:54Z Indexed on 2010/04/10 22:13 UTC
Read the original article Hit count: 205

Filed under:

Imagine the following folder structure:

  • project
    • src
      • code.c
      • makefile
    • bin

How can I compile code.c to code.o and directly put it inside bin? I know I could compile it to code.o under src and the do "mv code.o ../bin" but that would yield an error if there were compile errors, right? Even if it works that way, is there a better way to do it?

Thanks.

© Stack Overflow or respective owner

Related posts about makefile