[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make With Different Directories For Binaries and Source?

From: Andreas Wenzke
Subject: Make With Different Directories For Binaries and Source?
Date: Thu, 22 Apr 2010 21:57:37 +0200
User-agent: Thunderbird (Windows/20100228)

Suppose, I have the following directory structure:

  | +Debug
  | +Release
  | +foo
  | +foo

What I want is something like this:

  cd somelib/lib
  make $(CFG)  # build somelib first
  cd (back to where we started from)
  g++ -I somelib/lib -c -o bin/$(CFG)/*.obj src/*.cpp src/foo/*.cxx
  g++ -o -L somelib/lib -l somelib -o bin/$(CFG)/myapp bin/$(CFG)/*.obj

So, build somelib first, then build everything within src (recursively),
taking into account all includes (recursively, with dependencies) and
put all binaries/object files into bin.
Finally link everything together.

Could someone please point me into the right direction?
Unfortunately I have to meet a deadline, so I don't really have time to
read thick manuals. :-(
However, I don't expect a complete solution, some advice on where to
look would already help me a lot!

E.g., do I have do define targets with a path?
I.e. targets like "bin/$(CFG)/*.o:" or something like that?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]