From owner-freebsd-ports@freebsd.org Mon Mar 26 16:57:26 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 4415CF54D4F for ; Mon, 26 Mar 2018 16:57:26 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "nightmare.dreamchaser.org", Issuer "nightmare.dreamchaser.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B978E86C3B; Mon, 26 Mar 2018 16:57:25 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id w2QGvOi3085348; Mon, 26 Mar 2018 10:57:24 -0600 (MDT) (envelope-from freebsd@dreamchaser.org) Reply-To: freebsd@dreamchaser.org Subject: Re: .if and Makefile issues To: Don Lewis Cc: FreeBSD Mailing List References: <85769c6d-a71a-f2c6-8a65-ac9b82f534ab@dreamchaser.org> From: Gary Aitken Message-ID: <8e6d703c-5ac6-c741-b705-aebf5e909ee8@dreamchaser.org> Date: Mon, 26 Mar 2018 10:56:43 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 16:57:26 -0000 On 03/26/18 01:11, Don Lewis wrote: > On 25 Mar, Don Lewis wrote: >> On 25 Mar, Gary Aitken wrote: > I forgot that all of the lines from the "if" up to but not including > "fi" need to end with a \ so that make treats them all as one > multi-line shell command: > > post-build: > echo "***** post-build *****" > # Avoid executable name conflict with dcraw port > if [ -e ${WRKSRC}/dcraw ]; then \ > echo ===== dcraw exists ===== \ > mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw \ > else \ > echo ===== dcraw does not exist ===== \ > fi Thanks, and thanks also to Theron Tarigo for his solution. In case anyone in the future is looking at this: The above doesn't work because of a few missing ; (not a Makefile related issue; a shell syntax issue) What works: post-build: echo "***** post-build *****" #Avoid executable name conflict with dcraw port if [ -e ${WRKSRC}/dcraw ] ; then \ echo "===== dcraw exists =====" ; \ mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw ; \ else \ echo "===== dcraw does not exist =====" ; \ fi Thanks again, Gary