changeset 18056:7c9b07f0da73

makefile: allow local builds to work on windows/mingw32
author Bryan O'Sullivan <bryano@fb.com>
date Tue, 11 Dec 2012 13:44:00 -0800
parents 5522a7951bd7
children 6b88ded2a993
files Makefile
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Dec 10 12:14:55 2012 -0800
+++ b/Makefile	Tue Dec 11 13:44:00 2012 -0800
@@ -11,6 +11,9 @@
 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 @@
 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