🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #2279

Re: GNUmake question

#2279
From: Paul D. Smith
Date: Fri, 14 Aug 1998 00:00
35 lines
2041 bytes
Note that questions on GNU make belong on the gnu.utils.help or
gnu.utils.bug groups, not gnu.misc.discuss or gnu.gcc.help (and there's
no such group as "gnu.utils").

%% Deyoung Hong <hong@cisco.com> writes:

  dh> I want to write a general rule for SRC to OBJ where
  dh> 	SRC = a.c ../b.c sub/c.c
  dh> and
  dh> 	OBJ = obj/a.o ../obj/b.o sub/obj/c.o
  dh> i.e., the obj dir is inserted before the file.

  dh> Note that SRC contains source files in different directories.
  dh> How do I write a general make rule for it?

You can't write one rule to do all of this; you'll need to write a
separate implicit rule for each individual obj directory:

  obj/%.o : %.c
        ...

  ../obj/%.o : ../%.c
        ...

  sub/obj/%.o : sub/%.c
        ...

PS. Note your Reply-To: field is broken; it just says "@cisco.com".

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@baynetworks.com>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.
Technical Details
Message-ID: <p5n297a1s3.fsf@baynetworks.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35D36BE6.89C653A6@cisco.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,457c97cafa25d3a0
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1025b4,457c97cafa25d3a0
X-Google-Attributes: gid1025b4,public
From: psmith@baynetworks.com (Paul D. Smith)
Subject: Re: GNUmake question
Date: 1998/08/14
Message-ID: <p5n297a1s3.fsf@baynetworks.com>
X-Deja-AN: 381184816
References: <35D36BE6.89C653A6@cisco.com>
To: hong@cisco.com
Followup-To: gnu.utils.bug
X-Complaints-To: usenet@spinner.corpeast.baynetworks.com
X-Trace: spinner.corpeast.baynetworks.com 903117181 9104 192.32.138.39 (14 Aug 1998 17:53:01 GMT)
Organization: Bay Networks, Inc. / Billerica, MA
Reply-To: psmith@baynetworks.com
NNTP-Posting-Date: 14 Aug 1998 17:53:01 GMT
Newsgroups: gnu.misc.discuss,gnu.gcc.help