Patchwork [2,of,3,bsdmake,stable?] Makefile: do assignment and export in a single statement

login
register
mail settings
Submitter Augie Fackler
Date April 21, 2016, 3:30 p.m.
Message ID <d798163ea54318407c4a.1461252605@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/14764/
State Accepted
Headers show

Comments

Augie Fackler - April 21, 2016, 3:30 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1461247848 14400
#      Thu Apr 21 10:10:48 2016 -0400
# Branch stable
# Node ID d798163ea54318407c4a86ae65ec94774a19eb0a
# Parent  15b4ba1151e581c1e4b9833ce96a57bb6c468d9f
Makefile: do assignment and export in a single statement

This is portable between GNU and BSD make, whereas doing the export on
its own line confuses BSD make.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,7 @@ 
 #
 # % make PREFIX=/opt/ install
 
-PREFIX=/usr/local
-export PREFIX
+export PREFIX=/usr/local
 PYTHON=python
 $(eval HGROOT := $(shell pwd))
 HGPYTHONS ?= $(HGROOT)/build/pythons