hello bret,
thanks, that's pretty much what I needed. I hadn't thought of doing the 
dependencies like that, but it helps quite a bit.
Rather than making the makefile call another file in a different directory, I 
just moved the corelib.cpp and corelib.h files to the main directory, which 
solves the other problems.


Thanks,
Tyler Littlefield
email: [EMAIL PROTECTED]
web: tysdomain-com
Visit for quality software and web design.
skype: st8amnd2005

  ----- Original Message ----- 
  From: Brett McCoy 
  To: [email protected] 
  Sent: Friday, November 28, 2008 7:25 PM
  Subject: Re: [c-prog] making a makefile to compile multiple programs


  On Fri, Nov 28, 2008 at 9:15 PM, Tyler Littlefield <[EMAIL PROTECTED]> wrote:

  > My makefile skills are horrible as it is, but, I'm looking for some
  > pointers. I've got a folder called "core" which holds the core library
  > components.
  > Then I've got multiple programs that need to be made in to separate
  > executables but link with the generated .o files from core, and be set to
  > compile to ../bin.
  > Ideas and hints would be great. I'm not even really sure where to start.

  The typical way is to create a fake target and set all of your
  executables a dependency:

  all: exe1 exe2 exe3

  exe1: obj1.o obj2.o

  exe2: obj1.o obj3.o

  exe3: obj1.o obj3.o obj4.o

  So when you do 'make all' it makes everything.

  While make is a very useful tool, it's a bit antiquated. I really
  recommend learning SCons -- it's Python-based but easier to use than
  make.

  -- Brett
  ----------------------------------------------------------
  "In the rhythm of music a secret is hidden;
  If I were to divulge it, it would overturn the world."
  -- Jelaleddin Rumi


   

[Non-text portions of this message have been removed]

Reply via email to