help-gplusplus
[Top][All Lists]
Advanced

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

Re: organizing larger projects


From: Guy Harrison
Subject: Re: organizing larger projects
Date: Tue, 29 Jun 2004 17:38:57 -0000
User-agent: KNode/0.7.2

cppaddict wrote:

> I am in need of advice on how to organize medium/large C++ projects.
> Right now I'm working on a program that will uses classes from another
> program I already wrote, a normal enough situation.  Currenlty I'm
> using relative paths to point to the external objects, so my Makefile
> looks like this:
> 
> <Makefile>
> 
> CXX=bcc32
> CPPFLAGS=
> EXTDIR=..\external_directory
> 
> OBJS=Main.obj WinDirectory.obj PixelDumpReader.obj \
> CharsetFileCreator.obj \
> $(EXTDIR)\Char.obj $(EXTDIR)\Charset.obj $(EXTDIR)\Point.obj
> 
> all: $(OBJS)
> $(CXX) $(OBJS)
> 
> Main.obj : Main.cpp
> $(CXX) -c $(CPPFLAGS) $<
> 
> %.obj : %.cpp %.h
> $(CXX) -c $(CPPFLAGS) $<
> 
> </Makefile>
> 
> But to me this feels like a clunky and unscalable solution.  For
> example, what happens when my program uses object files from 10
> different directories?  What is the standard/proper way of handling
> situations like the above?

Search in the manual for VPATH. Hopefully my other reply has enough hints to
solve some of your issues.
 
> Thanks for any advice/references,

Using your post as a jumping off point...

Has anyone a hint to a half-decent makefile link/faq for (gmake) newbies?
It's understandable that such gets asked here. Would be nice to have a
somewhere to point at. The gmake manual is very comprehensive and
invaluable but unfortunately incomprehensible until just a few basics have
been grasped.


-- 
Guy Harrison


reply via email to

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