Patchwork [in,crew] makefile: allow local builds to work on windows/mingw32

login
register
mail settings
Submitter Bryan O'Sullivan
Date Dec. 11, 2012, 9:47 p.m.
Message ID <7c9b07f0da73ab9eb33b.1355262423@australite.local>
Download mbox | patch
Permalink /patch/65/
State Accepted
Commit 7c9b07f0da73ab9eb33b21aa97e5088a3b7dcaf7
Headers show

Comments

Bryan O'Sullivan - Dec. 11, 2012, 9:47 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1355262240 28800
# Node ID 7c9b07f0da73ab9eb33b21aa97e5088a3b7dcaf7
# Parent  5522a7951bd7e2b16831ba1736feb2e9145d7e58
makefile: allow local builds to work on windows/mingw32

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,9 @@  PURE=
 PYFILES:=$(shell find mercurial hgext doc -name '*.py')
 DOCFILES=mercurial/help/*.txt
 
+# Set this to e.g. "mingw32" to use a non-default compiler.
+COMPILER=
+
 help:
 	@echo 'Commonly used make targets:'
 	@echo '  all          - build program and documentation'
@@ -33,11 +36,15 @@  help:
 all: build doc
 
 local:
-	$(PYTHON) setup.py $(PURE) build_py -c -d . build_ext -i build_hgexe -i build_mo
+	$(PYTHON) setup.py $(PURE) \
+	  build_py -c -d . \
+	  build_ext $(COMPILER:%=-c %) -i \
+	  build_hgexe $(COMPILER:%=-c %) -i \
+	  build_mo
 	env HGRCPATH= $(PYTHON) hg version
 
 build:
-	$(PYTHON) setup.py $(PURE) build
+	$(PYTHON) setup.py $(PURE) build $(COMPILER:%=-c %)
 
 doc:
 	$(MAKE) -C doc