Commit c3f67183 authored by Iustin Pop's avatar Iustin Pop

Cleanup the Haskell-related Makefile.am variables

This should be more readable now. I wanted to even use the nicer
_SOURCES, but _SOURCES is special in Automake (again), so _SRCS it is.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 8efa942b
...@@ -125,7 +125,7 @@ CLEANFILES = \ ...@@ -125,7 +125,7 @@ CLEANFILES = \
tools/kvm-ifup \ tools/kvm-ifup \
stamp-srclinks \ stamp-srclinks \
$(nodist_pkgpython_PYTHON) \ $(nodist_pkgpython_PYTHON) \
$(HALLPROGS) $(HSRCS2) \ $(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
.hpc/*.mix htools/*.tix \ .hpc/*.mix htools/*.tix \
doc/hs-lint.html doc/hs-lint.html
...@@ -278,14 +278,14 @@ docrst = \ ...@@ -278,14 +278,14 @@ docrst = \
doc/upgrade.rst \ doc/upgrade.rst \
doc/walkthrough.rst doc/walkthrough.rst
HPROGS = \ HS_PROGS = \
htools/hbal \ htools/hbal \
htools/hscan \ htools/hscan \
htools/hail \ htools/hail \
htools/hspace htools/hspace
HALLPROGS = $(HPROGS) htools/test HS_ALL_PROGS = $(HS_PROGS) htools/test
HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS)) HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
# we don't add -Werror by default # we don't add -Werror by default
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
# extra flags that can be overriden on the command line # extra flags that can be overriden on the command line
...@@ -295,7 +295,7 @@ HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC ...@@ -295,7 +295,7 @@ HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
# directory for apidoc # directory for apidoc
HS_APIDOC = doc/hs-apidoc HS_APIDOC = doc/hs-apidoc
HSRCS = \ HS_LIB_SRCS = \
htools/Ganeti/HTools/CLI.hs \ htools/Ganeti/HTools/CLI.hs \
htools/Ganeti/HTools/Cluster.hs \ htools/Ganeti/HTools/Cluster.hs \
htools/Ganeti/HTools/Container.hs \ htools/Ganeti/HTools/Container.hs \
...@@ -317,8 +317,8 @@ HSRCS = \ ...@@ -317,8 +317,8 @@ HSRCS = \
htools/Ganeti/Luxi.hs \ htools/Ganeti/Luxi.hs \
htools/Ganeti/OpCodes.hs htools/Ganeti/OpCodes.hs
HSRCS2 = htools/Ganeti/HTools/Version.hs HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
HSRCS2IN = $(patsubst %,%.in,$(HSRCS2)) HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
$(RUN_IN_TEMPDIR): | $(all_dirfiles) $(RUN_IN_TEMPDIR): | $(all_dirfiles)
...@@ -417,11 +417,11 @@ qa_scripts = \ ...@@ -417,11 +417,11 @@ qa_scripts = \
bin_SCRIPTS = bin_SCRIPTS =
iallocators_SCRIPTS = iallocators_SCRIPTS =
if WANT_HTOOLS if WANT_HTOOLS
bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS)) bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS)) iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
endif endif
$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile $(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
BINARY=$(@:htools/%=%); \ BINARY=$(@:htools/%=%); \
$(GHC) --make \ $(GHC) --make \
$(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \ $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
...@@ -507,8 +507,8 @@ EXTRA_DIST = \ ...@@ -507,8 +507,8 @@ EXTRA_DIST = \
$(maninput) \ $(maninput) \
qa/qa-sample.json \ qa/qa-sample.json \
$(qa_scripts) \ $(qa_scripts) \
$(HSRCS) $(HSRCS2IN) \ $(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
$(HSRCPROGS) $(HS_PROG_SRCS)
man_MANS = \ man_MANS = \
man/ganeti.7 \ man/ganeti.7 \
...@@ -665,7 +665,7 @@ srclink_files = \ ...@@ -665,7 +665,7 @@ srclink_files = \
test/ganeti-cleaner_unittest.bash \ test/ganeti-cleaner_unittest.bash \
test/import-export_unittest.bash \ test/import-export_unittest.bash \
$(all_python_code) \ $(all_python_code) \
$(HSRCS) $(HSRCPROGS) $(HS_LIB_SRCS) $(HS_PROG_SRCS)
check_python_code = \ check_python_code = \
$(BUILD_BASH_COMPLETION) \ $(BUILD_BASH_COMPLETION) \
...@@ -945,7 +945,7 @@ lint: $(BUILT_SOURCES) ...@@ -945,7 +945,7 @@ lint: $(BUILT_SOURCES)
--rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts)) --rcfile ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
.PHONY: hlint .PHONY: hlint
hlint: $(HSRCS2) hlint: $(HS_BUILT_SRCS)
if tty -s; then C="-c"; else C=""; fi; \ if tty -s; then C="-c"; else C=""; fi; \
hlint --report=doc/hs-lint.html $$C htools hlint --report=doc/hs-lint.html $$C htools
...@@ -1021,7 +1021,7 @@ py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES) ...@@ -1021,7 +1021,7 @@ py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
--output $(CURDIR)/doc/py-apidoc --output $(CURDIR)/doc/py-apidoc
.PHONY: hs-apidoc .PHONY: hs-apidoc
hs-apidoc: $(HSRCS2) hs-apidoc: $(HS_BUILT_SRCS)
@test -n "$(HSCOLOUR)" || \ @test -n "$(HSCOLOUR)" || \
{ echo 'HsColour' not found during configure; exit 1; } { echo 'HsColour' not found during configure; exit 1; }
@test -n "$(HADDOCK)" || \ @test -n "$(HADDOCK)" || \
...@@ -1032,7 +1032,7 @@ hs-apidoc: $(HSRCS2) ...@@ -1032,7 +1032,7 @@ hs-apidoc: $(HSRCS2)
ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css
set -e ; \ set -e ; \
cd htools; \ cd htools; \
RELSRCS="$(HSRCS:htools/%=%)"; \ RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
for file in $$RELSRCS; do \ for file in $$RELSRCS; do \
hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \ hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
$(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \ $(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \
...@@ -1041,7 +1041,7 @@ hs-apidoc: $(HSRCS2) ...@@ -1041,7 +1041,7 @@ hs-apidoc: $(HSRCS2)
-t ganeti-htools -p haddock-prologue \ -t ganeti-htools -p haddock-prologue \
--source-module="%{MODULE/.//}.html" \ --source-module="%{MODULE/.//}.html" \
--source-entity="%{MODULE/.//}.html#%{NAME}" \ --source-entity="%{MODULE/.//}.html#%{NAME}" \
$(filter-out Ganeti/HTools/ExtLoader.hs,$(HSRCS:htools/%=%)) $(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
.PHONY: TAGS .PHONY: TAGS
TAGS: $(BUILT_SOURCES) TAGS: $(BUILT_SOURCES)
...@@ -1083,7 +1083,7 @@ live-test: all ...@@ -1083,7 +1083,7 @@ live-test: all
rm -f .hpc; ln -s ../.hpc .hpc; \ rm -f .hpc; ln -s ../.hpc .hpc; \
rm -f *.tix *.mix; \ rm -f *.tix *.mix; \
./live-test.sh; \ ./live-test.sh; \
hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HPROGS:htools/%=%)) \ hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
--output=live-test.tix ; \ --output=live-test.tix ; \
@mkdir_p@ ../doc/hs-coverage ; \ @mkdir_p@ ../doc/hs-coverage ; \
hpc markup --destdir=../doc/hs-coverage live-test \ hpc markup --destdir=../doc/hs-coverage live-test \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment