delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/06/20/05:56:58

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Wed, 20 Jun 2012 11:56:35 +0200
Message-ID: <CADXng5ucQ2hOxGTXge+qy++LssXeBk_27=1eVst9=qE+G359dw@mail.gmail.com>
Subject: Problem with path in Makefile / Expansion of environment variables
From: =?ISO-8859-1?Q?Henrik_Stentj=E4rn?= <mhrkjohansson AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q5K9usaH028634

In this Makefile (between the "---" lines (and attached)), the "foo"
example doesn't work although the "bar" example works (if the files
foo.cc and bar.cc exists in the right places).


-------------------------------------------
/cygdrive/c/tmp/foo: /cygdrive/c/tmp/foo.cc
        g++ -Wall -W -o /cygdrive/c/tmp/foo /cygdrive/c/tmp/foo.cc

C:\tmp\bar: C:\tmp\bar.cc
        g++ -Wall -W -o C:\tmp\bar C:\tmp\bar.cc
-------------------------------------------


Version of make: GNU Make 3.81


I can't seem to find any information about this behaviour. It causes
some trouble when trying to set absolute paths (in .bash_profile) that
are later used in the Makefile. Setting the environment variable
OBJROOT to "${HOME}/obj" and then referring to it in the Makefile will
use a path like the "foo" one above; using "${HOME}/obj" directly in
the Makefile will work because "${HOME}" expands differently in
different circumstances. My "HOME" is set to
"C:\Users\my_name\cyghome".

Best regards
Henrik Stentjärn

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019