On Thu, May 24, 2012 at 7:58 AM, Greg Chicares <[email protected]> wrote:
> I'd probably do something like this (which makes it easy to distinguish
> other POSIX systems, in case the need arises):
>
> uname_result := $(shell uname -s 2>NUL)
>
> ifeq (CYGWIN,$(findstring CYGWIN,$(uname_result)))
>  platform := cygwin
> else
>  platform := probably windows
> endif
>
> .PHONY: all
> all:
>        @echo $(platform)
>
> When run under Cygwin, that has the distressing effect of creating a
> 'NUL' file that windows can't delete; but you could remove '2>NUL' and
> live with "process_begin: CreateProcess(NULL, uname -s, ...) failed"
> when running under windows.

Better to do

uname_result := $(shell uname -s 2>&1)

and leave the failure case to the else clause.

-David Boyce

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to