(fwd) Re: gmake: feature or bug ?

Andrey Gerzhov (kittle@freeland.kiev.ua)
Fri, 26 Nov 1999 13:25:00 +0200 (EET)

-- forwarded message --
Path: freeland.kiev.ua!routki.ki.yurteh.net!carrier.kiev.ua!srcc!newsfeed.gamma.ru!Gamma.RU!ddt.demos.su!not-for-mail
From: Vadim Chekan <vadim@gc.lviv.ua>
Newsgroups: fido7.ru.unix
Subject: Re: gmake: feature or bug ?
Date: 22 Nov 1999 20:05:24 +0300
Organization: Galitian Contracts
Lines: 46
Sender: fido7@ddt.demos.su
Approved: <gateway@fido7.ru>
Message-ID: <38397594.FD453BA4@gc.lviv.ua>
References: <3262151822@diger.utc.telenet.ru>
NNTP-Posting-Host: ddt.demos.su
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
X-Trace: ddt.demos.su 943290327 17434 194.87.13.37 (22 Nov 1999 17:05:27 GMT)
X-Complaints-To: gatekeeper@fido7.ru
NNTP-Posting-Date: 22 Nov 1999 17:05:27 GMT
X-BeforeModerator-Path: not-for-mail
X-BeforeModerator-NNTP-Posting-Host: rio.cscd.lviv.ua
X-BeforeModerator-X-Trace: news.kiev.sovam.com 943290130 21495 212.109.34.130 (22 Nov 1999 17:02:10 GMT)
X-BeforeModerator-X-Complaints-To: newsmaster@news.kiev.sovam.com
X-BeforeModerator-NNTP-Posting-Date: 22 Nov 1999 17:02:10 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
Cache-Post-Path: xl2.cscd.lviv.ua!unknown@195.5.56.19
X-Cache: nntpcache 2.3.2 (see http://www.nntpcache.org/)
X-BeforeModerator-Sender: News Service <news@news.kiev.sovam.com>
Xref: freeland.kiev.ua fido7.ru.unix:13376

Vitaly Pinjagin wrote:
> Hе подскажет ли многоуважаемый All, что будет с файлом f.o,
> после выполнения
> touch f.c; rm -f *.[ob]; gmake -f Makefile-1 all
> --------- Makefile-1 ------------
> all: f.b
> all2: f.b f.o
> %.o: %.c
> cp $< $@
> %.b: %.o
> cp $< $@
> -------- end Makefile-1 ----------
>
> а если закоментарить строку "all2: f.b f.o" ?
>
> если *внезапное* появление 'rm f.o' вас не озадачило - то укажите мне то
> место в прсловутом RTFM-е которое погло бы энто пояснить.

Похоже на дело рук подразумеваемых правил (по умолчанию)

http://www.gnu.org/manual/make/html_chapter/make_10.html#SEC89
(Using Implicit Rules)

Linking a single object file
`n' is made automatically from `n.o' by running the linker (usually
called ld) via the C compiler. The precise command used is `$(CC)
$(LDFLAGS) n.o
$(LOADLIBES)'. This rule does the right thing for a simple program
with only one source file. It will also do the right thing if there are
multiple object files
(presumably coming from various other source files), one of which
has a name matching that of the executable file. Thus,

x: y.o z.o

when `x.c', `y.c' and `z.c' all exist will execute:

cc -c x.c -o x.o
cc -c y.c -o y.o
cc -c z.c -o z.o
cc x.o y.o z.o -o x
rm -f x.o
rm -f y.o
rm -f z.o

Вадим Чекан.
-- end of forwarded message --

-- 
С тем, что не помешает никогда,
                                               Kittle