This is the mail archive of the cygwin 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]
Other format: [Raw text]

make -k fails on cygwin [Was: Test failures in coreutils-5.3.0 on cygwin]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[cross-posted to cygwin and automake lists]
I'm not sure if the bug below is with cygwin's mods to make, in automake
for using non-portable Makefile constructs, or in both.

According to Jim Meyering on 1/12/2005 9:45 AM:
>>>If you run `make -k check', it will keep going in spite of failures.
> 
>> Nope, even with `make -k check', my run ends in:
>> ======================================
>> 1 of 5 tests failed
>> Please report to bug-coreutils@gnu.org
>> ======================================
>> make[3]: *** [check-TESTS] Error 1
>> make[3]: Leaving directory `/home/eblake/coreutils-5.3.0/tests/chgrp'
>> make[2]: *** [check-am] Error 2
>> make[2]: Target `check' not remade because of errors.
>> make[2]: Leaving directory `/home/eblake/coreutils-5.3.0/tests/chgrp'
>> make[1]: *** [check-recursive] Error 1
>> make[1]: Target `check' not remade because of errors.
>> make[1]: Leaving directory `/home/eblake/coreutils-5.3.0/tests'
>> make: *** [check-recursive] Error 1
>> make: Target `check' not remade because of errors.
> 
> Then you should use a make program that honors the -k option.
> There must be a GNU make port to cygwin.

It _is_ GNU make, but with cygwin modifications to accept --unix or
- --win32 to determine whether to use /bin/sh or the native DOS shell:
$ make --version
GNU Make 3.80
Copyright (C) 2002  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.
$ cat Makefile
all:
	@echo ${MAKEFLAGS}
$ make
- --unix
$ make -k
- --unix -k

Now look at what automake 1.9 sticks in to the Makefiles for recursive
traversal:
$(RECURSIVE_TARGETS):
        @set fnord $$MAKEFLAGS; amf=$$2; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
            local_target="$$target-am"; \
          else \
            local_target="$$target"; \
          fi; \
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
           || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;;
esac; \
        done; \
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"

Whoops - $amf is set to --unix, rather than the desired '' or -k.  The
case statement fails, and the recursive traversal of subdirs halts in
spite of my request to keep going.  As pointed out last month on the
libtool lists,
http://lists.gnu.org/archive/html/libtool-patches/2004-12/msg00091.html,
parsing $MAKEFLAGS is inherently non-portable.  `info make' also has a
page dedicated to "Phony Targets" that discusses the more portable way to
have a recursive target, although I don't know how well it scales to the
more than 15 recursive targets that automake creates.

     SUBDIRS = foo bar baz

     .PHONY: subdirs $(SUBDIRS)

     subdirs: $(SUBDIRS)

     $(SUBDIRS):
             $(MAKE) -C $@

     foo: baz


- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB50kf84KuGfSFAYARAmEdAKCTjFJlAWmPR9lDboMyGi8r2hiQNwCfaeQg
D/EyY+pF1kLs8c2LfOqD5O8=
=Elu+
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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