Re: Noobilicious: Is there a g++ option to specify 'source directories'?
From: florian schmidt (mista.nospam.tapas_at_gmx.nospam.net)
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]
-- to sign or not to sign, that is the question