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

login
register
mail settings
Submitter Augie Fackler
Date April 21, 2016, 2:16 p.m.
Message ID <c5e702fe862a157067f3.1461248202@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/14761/
State Changes Requested
Headers show

Comments

Augie Fackler - April 21, 2016, 2:16 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 c5e702fe862a157067f38824ce717ed603ee318b
# Parent  962950235062ec2e80c73f20083bb20c2773d681
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