X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=fViv96rlzs3PtroKPv+/Lc7QVgsppyNPlEplbWsrn4HTnjReFLDVL 7nS/Xvlzv3rX5VkLojIQNMDsIDjt7e7qIfoetDs2ZOM1Y+eMSzKhr92lYQH+sdJT T4DyKzrE4WS45MHbpGi4NvIIS3QrnsQjWOWdz1RPsbBiztKi7I7YUU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=rXFBfA4B3X8PhSNqti9Ul1Je3Lk=; b=p26YP+C0WwyNUM0TtYN/eX/Nbrc0 l+0i8d8ZjM/wC7wKP2kPCREH9wrq8EwLrLq0AumOrLm8tW6mOg2XcZ4uH3ut/U1j chsQT95xSNlMPqDRdY1Lm+H0dEeJhHwo0ocTp0cksvWqq5hak6cTBp7WBtBsxBrt BL0VaxiVdBGYhXU= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Tue, 22 Jul 2014 12:16:47 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Re: cygpath does not work properly in Makefile Message-ID: <20140722101647.GD2451@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <53CCF82E DOT 7040407 AT gmail DOT com> <53CE2DEA DOT 1030003 AT uni-bremen DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <53CE2DEA.1030003@uni-bremen.de> User-Agent: Mutt/1.5.23 (2014-03-12) --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jul 22 11:24, G=C3=B6k=C3=A7e Aydos wrote: > On 2014-07-21 13:23, Marco Atzeri wrote: > >I presume the make you are using is not cygwin one > >as the first form is understandable only by cygwin programs >=20 > I do not see a difference between the two lines, because the command > "cygpath" is used in both. I want to add that I get the behavior both und= er > Cygwin64 terminal and in Win command prompt with bash. If the cygpath is = run > embedded in another function, it does not produce a usable path for Windo= ws > programs. It's not cygpath at fault here. It's how make works. Your patsubst with a shell call in the replacement string simply doesn't work as intended. For testing purposes, replace cygpath with this simple test application: $ cat > mycygpath.c < int main (int argc, char **argv) { int i; for (i =3D 1; i < argc; ++i) { fprintf (stderr, "ARGV[%d] =3D '%s'\n", i, argv[i]); if (argv[i][0] =3D=3D '-') continue; if (argv[i][0] =3D=3D '/') { if (!strncmp (argv[i], "/cygdrive/c/", 7)) printf ("C:/%s\n", argv[i] + 7); else printf ("C:/cygwin64/%s\n", argv[i] + 1); } else if (!strncmp (argv[i], "./", 2)) printf ("%s\n", argv[i] + 2); else printf ("%s\n", argv[i]); } return 0; } EOF It works exactly as cygpath for your testcase, but additionally it reproduces the exact incoming argument string on stderr: $ gcc -o mycygpath mycygpath.c $ ./mycygpath lib1 ./relative.vhd /cygdrive/c/Windows/absolute.vhd ARGV[1] =3D 'lib1' lib1 ARGV[2] =3D './relative.vhd' relative.vhd ARGV[3] =3D '/cygdrive/c/Windows/absolute.vhd' C:/Windows/absolute.vhd Now change your Makefile like this: $ cat > Makefile <