delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/13/07:16:09

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-Id: <5.0.2.1.2.20020113120630.009e6c70@pop.gmx.net>
X-Sender: martinSteuer AT gmx DOT de@pop.gmx.net
X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
Date: Sun, 13 Jan 2002 12:27:49 +0100
To: djgpp AT delorie DOT com
From: Martin Steuer <martinSteuer AT gmx DOT de>
Subject: Re: Setting Env Var from within make
In-Reply-To: <7263-Sat12Jan2002192707+0200-eliz@is.elta.co.il>
References: <5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020112104932 DOT 009eaec0 AT pop DOT gmx DOT net>
<5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020111135643 DOT 009e11a0 AT pop DOT gmx DOT net>
<5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020110113803 DOT 009e0200 AT pop DOT gmx DOT net>
<5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020110113803 DOT 009e0200 AT pop DOT gmx DOT net>
<5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020111135643 DOT 009e11a0 AT pop DOT gmx DOT net>
<5 DOT 0 DOT 2 DOT 1 DOT 2 DOT 20020112104932 DOT 009eaec0 AT pop DOT gmx DOT net>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

At 19:27 12.01.2002 +0200, you wrote:
>Why do you ned this?  The details matter in this case, so please
>describe those details.

The problem is the following normally when using the -MMD option to gcc it 
will create a dependecy for a source file in a file called <sourcename>.d 
and the tragets name will be called <sourcename>.o.
But in my makefile i want to create the objects in a directory ./obj/ like so:

OBJPATH = ./obj/

$(OBJPATH)%.o : %.c
         $(CC) $(CFLAGS) -c $< -o $@

So now when i include the *.d dependecies the targets names are not the 
same and so make won't check for the change of the include files it just 
uses the above rule.
So every time gcc is invoked i want to change the content of 
DEPENDENCIES_OUTPUT where you can directly specify the targets name as the 
second value (i'd use $@ for it).

It could be so easy if i could specify the targets name directly to gcc, 
i'm currently using version 2.952, i think thats a feature which should be 
added to later versions (maybe it has already been done?).

I really want to do it this way because i think the whole directory 
structure is much clearer.

Greetings,
Martin

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019