[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird (and convenient) difference between cygwin and DOS
From: |
David Boyce |
Subject: |
Re: Weird (and convenient) difference between cygwin and DOS |
Date: |
Thu, 24 May 2012 08:04:26 -0400 |
On Thu, May 24, 2012 at 7:58 AM, Greg Chicares <address@hidden> 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:
> address@hidden $(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