Re: Bug#214592: dry-run of double-colon rules?

2003-11-11 Thread Manoj Srivastava
Hi,
  [Please retain the CC to [EMAIL PROTECTED]
   so that the Debian Bug Tracking system can record your
   input]

  This has been reported by a debian user.

In some cases, GNU make ignores some double-colon rules when dry-run.

Assumed this Makefile is given

 all: foo.1 foo.2
 foo.1:
 touch foo.1
 foo.2:
 touch foo.2

 install.man:: foo.1
 @echo install foo.1

 install.man:: foo.2
 @echo install foo.2

 install.man::
 @echo install done

I've got the following results

 % make
 touch foo.1
 touch foo.2
 % make -n install.man
 echo install foo.1
 echo install done

I expect "echo install foo.2", but make dry-run shows not to
run "install foo.2".
However, if I run make actually

 % make install.man
 install foo.1
 install foo.2
 install done

"install foo.2" is executed.  Is this an intentional behavior or a bug
of GNU make?

Note that pmake run as I expected

 % pmake -n install.man
 echo install foo.1
 echo install foo.2
 echo install done
 % pmake install.man
 install foo.1
 install foo.2
 install done

I know if I add ".PHONY: install.man" to Makefile, GNU make works as
well, but I experienced this by Makefile generated by xmkmf so that no
PHONY target was defined.

manoj
-- 
Laetrile is the pits.
Manoj Srivastava   <[EMAIL PROTECTED]>  
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


___
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make


Re: Bug#218367: make: strange behavior with multi-target rules

2003-11-11 Thread Manoj Srivastava
Hi,

  [Please retain the CC to [EMAIL PROTECTED]
   so that the Debian Bug Tracking system can record your
   input]

  This has been reported by a debian user.

Package: make
Version: 3.80-4

I have always thought that a normal (non-pattern) rule with multiple
targets gets run multiple times, once per each target that is out of
date.  At least, that's what the manual says.  Sometimes one would
like a different behavior, namely to update all the targets at once
with one run, but as long as it's documented and established I am
willing to live with it.  But there seems to be more to it.

MODULES := \
Blah \
Bleh \

SOURCES := $(addsuffix .sml,$(MODULES)) 

TEX := $(addsuffix .tex,$(MODULES)) 

modules.tex : $(TEX)
cat $(TEX) > modules.tex

$(TEX) : $(SOURCES)
./bin/plit $(SOURCES)

I have files Blah.sml and Bleh.sml.
Surprise #1: make modules.tex runs the last rule _once_ (which happens
to be what I want in this case).

Surprise #2: add a flag to the command, so now the last rule is

$(TEX) : $(SOURCES)
./bin/plit -n $(SOURCES)

touch one of the .sml files, make modules.tex again.  Now plit runs twice!

Surprise #3: refactor like this

$(TEX) : junk

junk: $(SOURCES)
./bin/plit -n $(SOURCES)

touch Blah.sml.  Now make modules.tex runs the last rule (once), but
not the first rule (for modules.tex itself), even though it clearly is
out of date!

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux homage 2.4.22custom1 #4 Fri Oct 3 19:15:17 PDT 2003 i586
Locale: LANG=C, LC_CTYPE=C

Versions of packages make depends on:
ii  libc6 2.3.2-7GNU C Library: Shared libraries an

manoj
-- 
People don't usually make the same mistake twice -- they make it three
times, four time, five times...
Manoj Srivastava   <[EMAIL PROTECTED]>  
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


___
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make


Re: Bug#218367: make: strange behavior with multi-target rules

2003-11-11 Thread Ted Stern
On 10 Nov 2003, Manoj Srivastava wrote:
>
> Surprise #3: refactor like this
>
> $(TEX) : junk
>
> junk: $(SOURCES)
>   ./bin/plit -n $(SOURCES)
>
> touch Blah.sml.  Now make modules.tex runs the last rule (once), but
> not the first rule (for modules.tex itself), even though it clearly is
> out of date!

In this case, make needs to build junk before it can build $(TEX).  But the
rule for junk doesn't actually build a file.  So $(TEX) can't be built.

Try declaring junk as a .PHONY target:

.PHONY:   junk

For better debugging of your problem, try running make with the -d flag.

Ted
-- 
 Ted Stern Applications Group
 Cray Inc.   office: 206-701-2182
 411 First Avenue South, Suite 600 cell: 206-383-1049
 Seattle, WA 98104-2860 FAX: 206-701-2500

 Frango ut patefaciam -- I break that I may reveal
 (The Paleontological Society motto, equally apropos for debugging)



___
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make


RE: Lucent nmake feature support

2003-11-11 Thread Andy Voelkel

>  av> The main thing I noticed is the built-in dependency scanner for
>  av> source code. That would be a welcome addition to GNU make. OPUS
>  av> had it, and it will be missed.
>
>You can get automated dependency scanning with GNU make, it just
doesn't
>come built-in.  But it's not hard to achieve, especially if you have a
>relatively decent compiler (like GCC).  But even without one you can do
>it pretty easily.  For example there are instructions at my web site
>(see the .sig).

Great site! Thanks for the reference. 

- Andy Voelkel



___
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make