summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-10-22 19:16:19 -0400
committerJoey Hess <joeyh@joeyh.name>2016-10-22 19:16:19 -0400
commit3cc43025868fa5115fc9f296f590daa8621e1acf (patch)
tree3fa6c080edd66a4d7ccab03e56289e88befe9a8f /Makefile
parent5aba9a772f5a9bf2c994bfb69d956ef694ae65df (diff)
downloadkeysafe-3cc43025868fa5115fc9f296f590daa8621e1acf.tar.gz
Makefile: Allow setting BUILDEROPTIONS=-j1 to avoid concurrent build, which should make build reproducible.
(And removed an accidential double $BUILDER build)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 9b2fcaa..f7dfb87 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@ PREFIX?=
# Can be "stack" or "cabal", or "./Setup" to build and use Setup.hs
BUILDER?=stack
+# Options to pass to the BUILDER.
+# Using -j1 may result in a reproducible build.
+BUILDEROPTIONS?=
+
# Propigate flags through ghc to linker and compiler.
ghc_options=$(shell \
for w in $(LDFLAGS); do \
@@ -24,12 +28,11 @@ build:
keysafe:
if [ "$(BUILDER)" = ./Setup ]; then ghc --make Setup; fi
if [ "$(BUILDER)" = stack ]; then \
- $(BUILDER) build --ghc-options="$(ghc_options)"; \
+ $(BUILDER) build --ghc-options="$(ghc_options)" $(BUILDEROPTIONS); \
else \
$(BUILDER) configure --ghc-options="$(ghc_options)"; \
- $(BUILDER) build; \
+ $(BUILDER) build $(BUILDEROPTIONS); \
fi
- $(BUILDER) build --ghc-options="$(ghc_options)"
if [ "$(BUILDER)" = stack ]; then \
ln -sf $$(find .stack-work/ -name keysafe -type f | grep build/keysafe/keysafe | tail -n 1) keysafe; \
else \