comparison Makefile @ 29003:c6b108555dfa stable

make: alter how we compute compiler flags for setup.py This is portable between BSD and GNU make. I'm not thrilled with how it worked out, but it's portable and solves the problem.
author Augie Fackler <augie@google.com>
date Thu, 21 Apr 2016 10:05:14 -0400
parents 8b6b6513c09f
children 145cdc45b0df
comparison
equal deleted inserted replaced
29002:ea794f2eb19d 29003:c6b108555dfa
16 export LC_ALL=C 16 export LC_ALL=C
17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS) 17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
18 18
19 # Set this to e.g. "mingw32" to use a non-default compiler. 19 # Set this to e.g. "mingw32" to use a non-default compiler.
20 COMPILER= 20 COMPILER=
21
22 COMPILERFLAG_tmp_ =
23 COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER)
24 COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}}
21 25
22 help: 26 help:
23 @echo 'Commonly used make targets:' 27 @echo 'Commonly used make targets:'
24 @echo ' all - build program and documentation' 28 @echo ' all - build program and documentation'
25 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))' 29 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
41 all: build doc 45 all: build doc
42 46
43 local: 47 local:
44 $(PYTHON) setup.py $(PURE) \ 48 $(PYTHON) setup.py $(PURE) \
45 build_py -c -d . \ 49 build_py -c -d . \
46 build_ext $(COMPILER:%=-c %) -i \ 50 build_ext $(COMPILERFLAG) -i \
47 build_hgexe $(COMPILER:%=-c %) -i \ 51 build_hgexe $(COMPILERFLAG) -i \
48 build_mo 52 build_mo
49 env HGRCPATH= $(PYTHON) hg version 53 env HGRCPATH= $(PYTHON) hg version
50 54
51 build: 55 build:
52 $(PYTHON) setup.py $(PURE) build $(COMPILER:%=-c %) 56 $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG)
53 57
54 wheel: 58 wheel:
55 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILER:%=-c %) 59 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG)
56 60
57 doc: 61 doc:
58 $(MAKE) -C doc 62 $(MAKE) -C doc
59 63
60 clean: 64 clean: