Re: Noobilicious: Is there a g++ option to specify 'source directories'?

From: florian schmidt (mista.nospam.tapas_at_gmx.nospam.net)
Date: 03/16/04


Date: Tue, 16 Mar 2004 12:00:32 +0100

On Mon, 15 Mar 2004 22:28:39 -0500, WTH wrote:

> I have some common unix code in a folder that I'd like to be able to refer
> to without using a wildcar like ./unixsource/* because some is for Linux
> and some is for Irix.
>
> Is there a way to tell g++ to look into particular directories for the
> files I list after "-c", for example:
>
> SOURCE_DIR = ./unixsource
>
> g++ -c CSceneGraph.cpp CNodes.cpp -I./includes -srcdir $(SOURCE_DIR)
>
> Or something like that...?
>
> I currently use:
>
> SOURCE_DIR = ./linuxsource/*
>
> g++ -c $(SOURCE_DIR) -I./includes
>
> but like I was saying, I would like to be able to specify particular files
> and not resort to a wildcard.

I would probably do something like this:

SOURCE_DIR = ./linuxsource/
SOURCES = foo1.cpp foo2.cpp foo3.cpp
REAL_SOURCES = $(SOURCES:%=$(SOURCE_DIR)%)

g++ ... $(REAL_SOURCES)

Dunno, if this works though.. haven't tried it [the variable evaluation in
the pattern replacement thing i'm not ure about. Try REAL_SOURCES =
$(SOURCES:%=./linuxsource/%) instead in that case]

Flo

-- 
to sign or not to sign, that is the question


Relevant Pages

  • Re: OpenGL on Octane
    ... So basically, that does corroborate what you were saying, they are ... running a much older version of IRIX on their machine and should ... upgrade. ...
    (comp.sys.sgi.graphics)
  • Re: Irix -> Win XP networking
    ... > What you're saying is Irix talks TCP/IP with no problem? ... I'm all new to Irix OS and whole SGI ... You can use telnet, ftp and rcp with no problems, you may want ...
    (comp.sys.sgi.misc)