Article View: comp.unix.programmer
Article #3756Re: A simple make rule looks hard....
From: Koushik Banerjee
Date: Mon, 18 Feb 2002 09:21
Date: Mon, 18 Feb 2002 09:21
41 lines
2345 bytes
2345 bytes
Eli Zaretskii wrote:
> Steve Simmons wrote:
> >
> > .1.man .2.man .3.man:
> > cp $< /usr/local/man/man$(S)/$<
> >
> > where $(S) is the suffix 1, 2, 3, etc. Damned if I can find a
> > way to get the suffix as any of gnu makes canned variables.
>
> Did you miss the description of the $(suffix) built-in function in the
> manual? AFAICS, something like $(subst .,,$(suffix $<)) should do what you
> want. (Warning: untested!)
I tried to do it some other way( I really didnot try , but just tried to make
sure it looked fine), the following way
==========
MAN_DIR=/usr/local/man
BLAFILES= .1.man .2.man .3.man
TARGET:=${BLAFILES:.%.bla=$(MAN_DIR)/man%}
all: $(TARGET)
$(MAN_DIR)/man% : .%.man
@cp $< $@/$<
===========
Here the copy rule will be executed once TARGET is being made from all. Just
give it a try, and let me know if it works. And since the dependency is on the
man files, it will be executed everytime the man file changes. Do let me know
if it works.
--
cheerio,
Koushik.
//
// << The idea expressed above are solely mine, and doesnot represent >>
// << that of my employer and/or any person implicitly/explicitly >>
Technical Details
Message-ID:
<3C70C79C.EBFD07CD@icmg.nu>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!164.164.94.8!not-for-mailReferences:
<3c6d5bc3$0$16579$4c41069e@reader0.ash.ops.us.uu.net> <3C6E0014.E0A67815@is.elta.co.il>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109f73,dc69bb7b45b9a336 X-Google-Attributes: gid109f73,public X-Google-Thread: fc89c,dc69bb7b45b9a336 X-Google-Attributes: gidfc89c,public X-Google-ArrivalTime: 2002-02-18 01:23:38 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!164.164.94.8!not-for-mail From: Koushik Banerjee <koushik.banerjee@icmg.nu> Newsgroups: comp.unix.programmer,gnu.utils.help Subject: Re: A simple make rule looks hard.... Date: Mon, 18 Feb 2002 14:51:32 +0530 Organization: iCMG Lines: 43 Message-ID: <3C70C79C.EBFD07CD@icmg.nu> References: <3c6d5bc3$0$16579$4c41069e@reader0.ash.ops.us.uu.net> <3C6E0014.E0A67815@is.elta.co.il> Reply-To: koushik.banerjee@icmg.nu NNTP-Posting-Host: 164.164.94.8 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1014024215 1789055 164.164.94.8 (16 [76340]) X-Mailer: Mozilla 4.73 [en] (WinNT; U) X-Accept-Language: en