[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portable makefiles - portable shell commands?
From: |
Eli Zaretskii |
Subject: |
Re: Portable makefiles - portable shell commands? |
Date: |
Mon, 04 Apr 2005 22:18:38 +0300 |
> Date: Sun, 3 Apr 2005 17:31:25 -0800
> From: Jonathan Baccash <address@hidden>
> Cc: address@hidden
>
> You can use environment variable(s) like SHELL to determine if this is
> a Unix-like shell
Unfortunately, this won't work: the variable SHELL is not normally set
on non-Posix systems, e.g. MS-Windows.
> or use a command like uname to figure out what platform you're
> using.
This won't work either: uname is not available on non-Posix
platforms.
> Based on these findings, you can define a function like RM := rm -f
> or RM := del. Then just use $(RM).
This won't work: "del" is not an equivalent replacement for "rm -f".
For example, on some versions of Windows "del *.o *~" will barf
because "del" cannot grok more than one argument on those versions of
Windows.
> Or you can use Cygwin
This won't work: Cygwin ports don't understand the Windows d:\foo\bar
file-name syntax. More importantly, you don't want to force your
users to install Cygwin.