From owner-freebsd-ports@freebsd.org Mon Mar 26 05:23:42 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74418F6CB08 for ; Mon, 26 Mar 2018 05:23:42 +0000 (UTC) (envelope-from theron.tarigo@gmail.com) Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEEA06B345 for ; Mon, 26 Mar 2018 05:23:41 +0000 (UTC) (envelope-from theron.tarigo@gmail.com) Received: by mail-qt0-x22b.google.com with SMTP id f8so18373223qtg.12 for ; Sun, 25 Mar 2018 22:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=cZNgcgZjDDtuQzJr6MqM0ZcX3IPS0TWajVHJIhmdOpg=; b=ITr9QtxINrPHHqsidR0E/2Wn8XKAbYhdbFWBI6PfP6s1CIl3F30AjBCiyPHHb/Qzj6 scuTYYr1G8P1R1bJ15PpGRHDO2CFomNh0z09GiAHYeMwUILX2KCRV1L2BDBTKEvjdTiu hXRcz9zQFvAHZOFFtofrKLhpQDtHe11sdqE9mUuMDKqU2r4mvaE+q5RbW2b7ORR7BLtA sqfmjDbJRPe9MWAgvrndz9xIlJNi874WcNGM7uuAVwR4mJEjH3j1Auhc494ChRVW23o4 GRm1vl/prDJ0ihuauzmGe5DfkKwqWYUA9rFADQuH5kzl8ZEEMszTJaN5JAO2nudO5dPt ESTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cZNgcgZjDDtuQzJr6MqM0ZcX3IPS0TWajVHJIhmdOpg=; b=Y1phuhI5P5kIe1YjtzqGZrkrGNCJSRpgbFd2rT1UhL3eCstAu0CXM5ZxL+cnxZDoZ8 1hgky3s4Jo/lTJPdNNw6QFS3SKgTBF6j+X3DkzJy9rADcqieluaEG0bloL02nHk2jFfq GX1ja31eOkf7yvEoZ4YDVuJkb/a8j0oANsieJ+mcX9Zw0UxoyoY/HWjaIGWaQ5XZWaDv yYMsGIRAnlJUe/Szwcpj+M3+jFKf5fVRzQfoM1rUsHyO6vP0GXFUzFqK2r/aOPiWmyrt LL/0bJHTH8KuEOAq2oIwcTmDZzuIJusgK5Ngj0Lgq0MOPZ2OLZHjgiO6XmeLyFnUtN7W Evzw== X-Gm-Message-State: AElRT7FkEQ0iC+1vv+YxvgORcauzdgNRsrEOpV+RcrjIKCKgOt2+lbz6 MHzpAB7AYuXe4h3RccqF7NPCgQH95+w= X-Google-Smtp-Source: AG47ELuBmV7MtI7UJmMaQzskdGXyy0DPiC5OtNnq3CLKDKSPx4sdsga6JPameZMVBkpZtN2ZwU57QA== X-Received: by 10.200.58.167 with SMTP id x36mr55670516qte.11.1522041821285; Sun, 25 Mar 2018 22:23:41 -0700 (PDT) Received: from [168.122.12.186] (dhcp-wifi-8021x-168-122-12-186.bu.edu. [168.122.12.186]) by smtp.gmail.com with ESMTPSA id r127sm3286862qkb.42.2018.03.25.22.23.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 22:23:40 -0700 (PDT) Sender: Theron Tarigo Subject: Re: .if and Makefile issues To: freebsd@dreamchaser.org, FreeBSD Mailing List References: <85769c6d-a71a-f2c6-8a65-ac9b82f534ab@dreamchaser.org> From: Theron Tarigo Message-ID: Date: Mon, 26 Mar 2018 01:23:40 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <85769c6d-a71a-f2c6-8a65-ac9b82f534ab@dreamchaser.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 05:23:42 -0000 On 03/26/18 00:50, Gary Aitken wrote: > 1. Why does the .if, .else, and .endif have to have no leading > whitespace? The tells Make that the line contains a command to run in the shell when executing a rule.  ".if", etc. are statements understood only to Make itself. > 2. Why does it require the on the stmt after the else but not >    after the .if?  (Same behavior with tabs on the ones after .if) The IS required before the "echo" after the ".if".  The "echo" you have written (with no preceding ) wouldn't be run even if the ".if" were to succeed - without the , Make interprets it as a Make statement but it has no effect. > 3. Why doesn't it find the file? The ".if", etc. statements are evaluated when the Makefile is read, thus do not reflect the state of the files mid-build. > 4. What's a right way to do this? This can be done with the shell: (note the escapes) test -f ${WRKSRC}/dcraw && \   mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw || \   echo "===== dcraw does not exist =====" However, it may be better to simply try to move the file but return success even if it does not exist: mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw || true