delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/15/19:27:32

From: luke AT research DOT canon DOT com DOT au (Luke Kendall)
Subject: B19.1 make.exe - mishandling set -e, excessive target activity
15 Oct 1998 19:27:32 -0700 :
Message-ID: <3625A224.3A061C96.cygnus.gnu-win32@research.canon.com.au>
Mime-Version: 1.0
To: bug-gnu-utils AT prep DOT ai DOT mit DOT edu, gnu-win32 AT cygnus DOT com
Cc: luke AT research DOT canon DOT com DOT au

Apologies if this is the wrong place(s) to report these problems.
make.exe suggested the first address; reading between the lines
of "reporting bugs" on the web pages suggests the 2nd...

I'm doing this under Windows NT4.0 sp3, using Cygnus Beta 19.1
and therefore GNU Make version 3.75-B19.

Problem 1
---------
The first problem is a peculiar difference between gmake under
Unix and Windows.  In the makefile shown below, the first
part of the main target is to make sure that errors are ignored
or not in blocks of shell commands, by detecting -k.

The problem is that it works under Unix and fails on my machine.
Deleting the "set -e" line makes it work under NT!

MAKE_MODE = UNIX
SUBDIRS = a b c

#
# Targets for various build tasks.
#
all :
        @set -e;\
        for flg in $(MAKEFLAGS) '';\
        do\
            case $$flg in\
            *=*) ;;\
            *k*) set +e;;\
            esac;\
        done;\
        for d in $(SUBDIRS);\
        do\
            echo cd $$d;\
            cd $$d;\
            echo $(MAKE) $@;\
            $(MAKE) $@;\
            cd ..;\
        done

Problem 1b:
----------
Another oddity is that if you change the early part to:

all :
        @echo "subdirs are: $(SUBDIRS)";\
        set -e;\

then it looks like some odd "echo" command is used
that doesn't understand quoting or ";" separators, as
it also grabs all the following lines for the "echo".

You'll note that this is despite the MAKE_MODE = UNIX

The second problem may be related.

Problem 2
---------
If I make these two files:

--- file test.gmk ---

all:
	@echo all done

include other

--- file other ---

do_other:
	@echo other stuff

----

And try:
	make -f test.gmk -d

The output (and the amount of time make takes) suggests
that it is really trying to treat  "test.gmk" and "other"
as targets!!

This is true of gmake under Unix and Windows.

Needless to say, the traditional Unix make doesn't
behave this way.

The reason I stumbled over this was while trying to debug
a much more complex makefile, and in the debug output I
saw attempts to find rules for files which shouldn't even
have been included...

BTW, what's the SIGCHLD and unreaped child?  It looks worrying:

Must remake target `all'.
Putting child 0x02a7a1a0 PID 01001 on the chain.
Live child 0x02a7a1a0 PID 1001
all done
Got a SIGCHLD; 1 unreaped children.
Live child 0x02a7a1a0 PID 1001
Reaping winning child 0x02a7a1a0 PID 1001
Removing child 0x02a7a1a0 PID 1001 from chain.
Successfully remade target file `all'.

I noticed two other queries when I did a search on "unreaped",
but no replies to the queries.

Regards,

luke
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019