Make v3.79, for Windows32
I'm using Cygwin and built the W32 version of Make with the HAVE_CYGWIN_SHELL cpp symbol set. I'm seeing two problems: o Quoted expressions in shell commands don't seem to translate across platforms. In the SunOS5.6 and Cygwin versions of make 3.78.1, I could use the following: subdirs: $(DIRS) if [ "x$(DIRS)" != x ]; then \ for dir in $(DIRS); do \ (cd $$dir && $(MAKE)); \ done; \ fi When I switched to 3.79 (built for W32), I had to change the double quotes to single quotes to avoid a shell error. o I cannot terminate a recursive make from bash. Once the sub makes are started, C-c from the command line terminates the immediate make process, but secondary make continues. Thanks. -andre.
Re: Make v3.79, for Windows32
On Thu, 15 Jun 2000, Andre Srinivasan wrote: > o Quoted expressions in shell commands don't seem to translate > across platforms. In the SunOS5.6 and Cygwin versions of > make 3.78.1, I could use the following: > > subdirs: $(DIRS) > if [ "x$(DIRS)" != x ]; then \ > for dir in $(DIRS); do \ > (cd $$dir && $(MAKE)); \ > done; \ > fi > > When I switched to 3.79 (built for W32), I had to change the > double quotes to single quotes to avoid a shell error. Are you sure this is Make issue, not a shell issue? In other words, are you sure Make invokes Bash in this case? If it invokes the Windows shell, then I can understand why you are having problems with quotes.
Parallel mode: Problem with Re-executing after Makefile-includes building
Hi, I am using gmake version 3.77 under Linux. My Makefile uses an include which is built with commands from the Makefile. In the nonparallel mode (without -j), make does the Re-execution described in the manual after generating the include. In the parallel mode (make -j), this remains undone: The include is built, but make does not restart, so the rules from the include do not apply. What do I expect: Same behaviour from 'make' and 'make -j' calls. Makefile: > include a.inc all: a.inc a.inc: echo "all:" > $@_ echo " echo doing all" >> $@_ echo >> $@_ echo ".PHONY: all" >> $@_ mv $@_ $@ <<< /home/jork> uname -a Linux maria 2.2.1 #17 SMP Mon Mar 1 12:48:29 CET 1999 i686 unknown /home/jork> make --version GNU Make version 3.77, by Richard Stallman and Roland McGrath. Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Report bugs to <[EMAIL PROTECTED]>. -- Dipl.-Inf. Jork Loeser Dresden University of Technology Department of Computer Science Operating Systems Research Group Phone: +49 (351) 463-8056Fax: +49 (351) 463-8284 Email: [EMAIL PROTECTED] WWW: os.inf.tu-dresden.de/~jork
Re: Parallel mode: Problem with Re-executing after Makefile-includes building
%% Jork Loeser <[EMAIL PROTECTED]> writes: jl> I am using gmake version 3.77 under Linux. Please try a later version; your example works for me with 3.79. -- --- Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: http://www.gnu.org http://www.paulandlesley.org/gmake/ "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
Re: Make v3.79, for Windows32
On Thu, 15 Jun 2000, Andre Srinivasan wrote: > o Quoted expressions in shell commands don't seem to translate > across platforms. In the SunOS5.6 and Cygwin versions of > make 3.78.1, I could use the following: > > subdirs: $(DIRS) > if [ "x$(DIRS)" != x ]; then \ > for dir in $(DIRS); do \ > (cd $$dir && $(MAKE)); \ > done; \ > fi > > When I switched to 3.79 (built for W32), I had to change the > double quotes to single quotes to avoid a shell error. EZ> Are you sure this is Make issue, not a shell issue? In other EZ> words, are you sure Make invokes Bash in this case? If it invokes EZ> the Windows shell, then I can understand why you are having EZ> problems with quotes. I just checked that indeed bash is being invoked: $ cat Makefile all: echo $$SHELL $ make echo $SHELL d:/cygnus/cygwin-b20/usr/local/bin/sh.exe $ -andre.
does gnumake 3.77 wildcard work under solaris 2.6?
We're trying to use the wildcard function in gnumake, and find that it produces nothing. The goal is to produce a list of the .o files that should be checked against all the .f files in a directory, as directly from page 18 of the 3.77 manual (and as of some earlier versions of gnumake that worked). "Making" with the attached Makefile in a directory with more than a dozen .f files produces the following output: % gnumake echo echo echo echo The old syntax (from an earlier gnumake) we think omitted the colon in the := assignment. We tried that too with the same results. Here's the Makefile. Any thoughts for us? Thanks, John Lewis cut here - OBJECTS := $(patsubst %.f, %.o, $(wildcard *.f)) TESTOBJ := $(patsubst %.f,%.o,$(wildcard *.f)) test: echo $($(wildcard *.f)) echo $(wildcard *.f) echo $(TESTOBJ) echo $(OBJECTS) -- John G. Lewis | [EMAIL PROTECTED] Technical Fellow| [EMAIL PROTECTED] The Boeing Company | tele: (425) 865-3510 Mail Code 7L-22 | fax : (425) 865-2966 P.O. Box 3707 | Seattle WA 98124-2207 | ---
RE: does gnumake 3.77 wildcard work under solaris 2.6?
This is a known bug in 3.77. 3.79 is the current version, you really need to update. -- Howard Chu Chief Architect, Symas Corp. Director, Highland Sun http://www.symas.com http://highlandsun.com/hyc > -Original Message- > From: John Lewis 425-865-3510 [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 15, 2000 10:07 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: does gnumake 3.77 wildcard work under solaris 2.6? > > > We're trying to use the wildcard function in gnumake, and > find that it produces nothing. The goal is to produce > a list of the .o files that should be checked against all the > .f files in a directory, as directly from page 18 of the 3.77 > manual (and as of some earlier versions of gnumake that worked). > > "Making" with the attached Makefile in a directory with more > than a dozen .f files produces the following output: > > % gnumake > echo > > echo > > echo > > echo > > > The old syntax (from an earlier gnumake) we think omitted the > colon in the := assignment. We tried that too with the same results. > > Here's the Makefile. Any thoughts for us? > > Thanks, > > John Lewis > cut here - > OBJECTS := $(patsubst %.f, %.o, $(wildcard *.f)) > > TESTOBJ := $(patsubst %.f,%.o,$(wildcard *.f)) > > test: > echo $($(wildcard *.f)) > echo $(wildcard *.f) > echo $(TESTOBJ) > echo $(OBJECTS) > > > > -- > > John G. Lewis | [EMAIL PROTECTED] > Technical Fellow | [EMAIL PROTECTED] > The Boeing Company | tele: (425) 865-3510 > Mail Code 7L-22 | fax : (425) 865-2966 > P.O. Box 3707 | > Seattle WA 98124-2207 | > --- >
Re: Make v3.79, for Windows32
> From: "Andre Srinivasan" <[EMAIL PROTECTED]> > Date: Thu, 15 Jun 2000 10:05:18 -0700 (GMT-8:00) > > I just checked that indeed bash is being invoked: > > $ cat Makefile > > all: > echo $$SHELL > > $ make > echo $SHELL > d:/cygnus/cygwin-b20/usr/local/bin/sh.exe > $ It would be more convincing to have a proof that Bash is called to run the command where the problem happens. Perhaps the quote style changes Make's decision about this. If Bash is indeed called, I'd guess this is some bug between Make and Bash.
Re: Make v3.79, for Windows32
... EZ> It would be more convincing to have a proof that Bash is called to EZ> run the command where the problem happens. Perhaps the quote EZ> style changes Make's decision about this. EZ> If Bash is indeed called, I'd guess this is some bug between Make EZ> and Bash. I'm not sure how to prove that bash is being called if indeed Make is choosing based on quote style. This is the rule that fails for me. -andre. DIRS = foo bar all: if [ "x$(DIRS)" != x ]; then \ targets="$(MAKECMDGOALS)"; \ if [ "x$$targets" = x ]; then \ targets=all; \ fi; \ for target in $$targets; do \ for dir in $(DIRS) NoSuchFile; do \ if [ $$dir != NoSuchFile ]; then \ if [ x$(subdirTrace) != x ]; then \ echo; echo Make $$target $$dir; echo; \ fi; \ (cd $$dir && $(MAKE) $$target); \ fi; \ done; \ done; \ fi
PATCH: Multiple-target pattern rules do the wrong thing with subdirs.
(Make version 3.79.) Consider this Makefile: %.1 %.2: %.src cp $< $*.1 cp $< $*.2 Create a file sub/foo.src and 'make -Rp sub/foo.1'. Here's an excerpt from the output: # Not a target: sub/foo.1: sub/foo.src # Command-line target. # Implicit rule search has been done. # Implicit/static pattern stem: `sub/foo' # Also makes: foo.2 # Last modified 2000-06-15 17:49:23 # File has been updated. # Successfully updated. # automatic # ^ := sub/foo.src # automatic # @ := sub/foo.1 # automatic # + := sub/foo.src # automatic # ? := sub/foo.src # automatic # * := sub/foo # automatic # % := # automatic # < := sub/foo.src # 7 variables in 23 hash buckets. # average of 0.3 variables per bucket, max 2 in one bucket. # commands to execute (from `Makefile', line 2): cp $< $*.1 cp $< $*.2 # Not a target: foo.2: # Implicit rule search has not been done. # File does not exist. # File has been updated. # Successfully updated. Note that make is incorrectly dropping the subdirectory path from the extra targets. Here's a patch to fix it: diff -rc /x/sethml/src/make-3.79/implicit.c ./implicit.c *** /x/sethml/src/make-3.79/implicit.c Fri Jan 21 21:43:03 2000 --- ./implicit.cThu Jun 15 17:28:50 2000 *** *** 117,122 --- 117,123 /* The start and length of the stem of FILENAME for the current rule. */ register char *stem = 0; register unsigned int stemlen = 0; + unsigned int fstemlen; /* Buffer in which we store all the rules that are possibly applicable. */ struct rule **tryrules *** *** 582,599 } if (!checked_lastslash[foundrule]) ! /* Always allocate new storage, since STEM might be !on the stack for an intermediate file. */ ! file->stem = savestring (stem, stemlen); else { /* We want to prepend the directory from the original FILENAME onto the stem. */ ! file->stem = (char *) xmalloc (((lastslash + 1) - filename) !+ stemlen + 1); bcopy (filename, file->stem, (lastslash + 1) - filename); bcopy (stem, file->stem + ((lastslash + 1) - filename), stemlen); ! file->stem[((lastslash + 1) - filename) + stemlen] = '\0'; } file->cmds = rule->cmds; --- 583,603 } if (!checked_lastslash[foundrule]) ! { ! /* Always allocate new storage, since STEM might be !on the stack for an intermediate file. */ ! file->stem = savestring (stem, stemlen); ! fstemlen = stemlen; ! } else { /* We want to prepend the directory from the original FILENAME onto the stem. */ ! fstemlen = ((lastslash + 1) - filename) + stemlen; ! file->stem = (char *) xmalloc (fstemlen + 1); bcopy (filename, file->stem, (lastslash + 1) - filename); bcopy (stem, file->stem + ((lastslash + 1) - filename), stemlen); ! file->stem[fstemlen] = '\0'; } file->cmds = rule->cmds; *** *** 606,617 if (i != matches[foundrule]) { struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); ! new->name = p = (char *) xmalloc (rule->lens[i] + stemlen + 1); bcopy (rule->targets[i], p, rule->suffixes[i] - rule->targets[i] - 1); p += rule->suffixes[i] - rule->targets[i] - 1; ! bcopy (stem, p, stemlen); ! p += stemlen; bcopy (rule->suffixes[i], p, rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1); new->file = enter_file (new->name); --- 610,621 if (i != matches[foundrule]) { struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); ! new->name = p = (char *) xmalloc (rule->lens[i] + fstemlen + 1); bcopy (rule->targets[i], p, rule->suffixes[i] - rule->targets[i] - 1); p += rule->suffixes[i] - rule->targets[i] - 1; ! bcopy (file->stem, p, fstemlen); ! p += fstemlen; bcopy (rule->suffixes[i], p, rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1); new->file = enter_file (new->name);
PATCH: .SECONDARY target with no dependencies does not work correctly.
(Make version 3.79.) Consider: % cat Makefile %.1: %.2 cp $< $@ %.2: %.3 cp $< $@ .SECONDARY: % ls Makefile foo.3 % make foo.1 cp foo.3 foo.2 cp foo.2 foo.1 rm foo.2 According to the documentation, the .SECONDARY target should cause all files to be considered secondary (and thus not deleted), but it doesn't work. I think that this is because the code to handle the .SECONDARY target with no dependencies marks all known files as secondary, but is run before pattern rules are followed and thus doesn't mark the results of pattern rules. Since .SECONDARY is only really useful on the targets of pattern rules, this rather defeats the purpose. At the end of this email is a rather crude patch to fix the problem. A more general issue: the documentation says: You can also list the target pattern of an implicit rule (such as `%.o') as a dependency file of the special target `.PRECIOUS' to preserve intermediate files created by rules whose target patterns match that file's name. This documents rather bizarre behaviour: it only works for pattern rules which specify the exact pattern mentioned (`%.o') and not ones which mention a different pattern which matches the same filenames (say, `%.foo.o'). It's easy for a user to expect different behaviour - e.g. that '.PRECIOUS: %' would make all files precious. It's also odd that .SECONDARY and .INTERMEDIATE don't seem to do anything useful with pattern dependencies. I propose that for special targets with pattern dependencies, all files should be matched against the patterns, and any files which match should have the special behaviour. Then the no-dependency case of .SECONDARY would be equivalent to '.SECONDARY: %'. Anyway, here's the patch: diff -rc /x/sethml/src/make-3.79/file.c ./file.c *** /x/sethml/src/make-3.79/file.c Mon Mar 27 08:20:40 2000 --- ./file.cThu Jun 15 16:09:10 2000 *** *** 34,39 --- 34,42 #endif static struct file *files[FILE_BUCKETS]; + /* Are all files considered secondary? */ + static int all_secondary = 0; + /* Number of files with the `intermediate' flag set. */ unsigned int num_intermediates = 0; *** *** 384,390 register struct file *f; char doneany; ! if (question_flag || touch_flag) return; if (sig && just_print_flag) return; --- 387,393 register struct file *f; char doneany; ! if (question_flag || touch_flag || all_secondary) return; if (sig && just_print_flag) return; *** *** 504,517 for (f2 = d->file; f2 != 0; f2 = f2->prev) f2->intermediate = f2->secondary = 1; } ! /* .SECONDARY with no deps listed marks *all* files that way. */ else ! { ! int i; ! for (i = 0; i < FILE_BUCKETS; i++) ! for (f2 = files[i]; f2; f2= f2->next) ! f2->intermediate = f2->secondary = 1; ! } } f = lookup_file (".EXPORT_ALL_VARIABLES"); --- 507,516 for (f2 = d->file; f2 != 0; f2 = f2->prev) f2->intermediate = f2->secondary = 1; } ! /* .SECONDARY with no deps listed marks *all* files that way. !* We haven't seen all intermediate files yet, use a global flag. */ else ! all_secondary = 1; } f = lookup_file (".EXPORT_ALL_VARIABLES");