This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

B19.1 make.exe - mishandling set -e, excessive target activity


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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]