exit 1; \
fi
BINARY=$(@:htools/%=%); $(GHC) --make \
- $(HFLAGS) $(HEXTRA) \
+ $(HFLAGS) \
$(HTOOLS_NOCURL) $(HTOOLS_PARALLEL3) \
- -osuf $$BINARY.o -hisuf $$BINARY.hi $@
+ -osuf $$BINARY.o -hisuf $$BINARY.hi \
+ $(HEXTRA) $@
# for the htools/test binary, we need to enable profiling/coverage
htools/test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
sed -e "s/%ver%/$$VCSVER/" < $< > $@
htools/Ganeti/Constants.hs: htools/Ganeti/Constants.hs.in \
- lib/constants.py lib/_autoconf.py $(CONVERT_CONSTANTS)
+ lib/constants.py lib/_autoconf.py $(CONVERT_CONSTANTS) \
+ | lib/_vcsversion.py
set -e; \
{ cat $< ; PYTHONPATH=. $(CONVERT_CONSTANTS); } > $@
./autogen.sh && \
./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var
+Haskell development notes
+-------------------------
+
+There are a few things which can help writing or debugging the Haskell
+code.
+
+You can run the Haskell linter :command:`hlint` via::
+
+ make hlint
+
+This is not enabled by default as it gets many false positives, and
+thus the normal output is not “clean”. The above command will generate
+both output on the terminal and also a HTML report at
+``doc/hs-lint.html``.
+
+When writing or debugging TemplateHaskell code, it's useful to see
+what the splices are converted to. This can be done via::
+
+ make HEXTRA="-ddump-splices"
+
+Due to the way TemplateHaskell works, it's not straightforward to
+build profiling code. The recommended way is::
+
+ make clean
+ make htools/htools HEXTRA="-osuf .o"
+ rm htools/htools
+ make htools/htools HEXTRA="-osuf .prof_o -prof -auto-all"
+
+This will build the binary twice, per the TemplateHaskell
+documentation, the second one with profiling enabled.
+
Packaging notes
===============