Revision c3f67183 Makefile.am

b/Makefile.am
125 125
	tools/kvm-ifup \
126 126
	stamp-srclinks \
127 127
	$(nodist_pkgpython_PYTHON) \
128
	$(HALLPROGS) $(HSRCS2) \
128
	$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
129 129
	.hpc/*.mix htools/*.tix \
130 130
	doc/hs-lint.html
131 131

  
......
278 278
	doc/upgrade.rst \
279 279
	doc/walkthrough.rst
280 280

  
281
HPROGS = \
281
HS_PROGS = \
282 282
	htools/hbal \
283 283
	htools/hscan \
284 284
	htools/hail \
285 285
	htools/hspace
286 286

  
287
HALLPROGS = $(HPROGS) htools/test
288
HSRCPROGS = $(patsubst %,%.hs,$(HALLPROGS))
287
HS_ALL_PROGS = $(HS_PROGS) htools/test
288
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
289 289
# we don't add -Werror by default
290 290
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
291 291
# extra flags that can be overriden on the command line
......
295 295
# directory for apidoc
296 296
HS_APIDOC = doc/hs-apidoc
297 297

  
298
HSRCS = \
298
HS_LIB_SRCS = \
299 299
	htools/Ganeti/HTools/CLI.hs \
300 300
	htools/Ganeti/HTools/Cluster.hs \
301 301
	htools/Ganeti/HTools/Container.hs \
......
317 317
	htools/Ganeti/Luxi.hs \
318 318
	htools/Ganeti/OpCodes.hs
319 319

  
320
HSRCS2 = htools/Ganeti/HTools/Version.hs
321
HSRCS2IN = $(patsubst %,%.in,$(HSRCS2))
320
HS_BUILT_SRCS = htools/Ganeti/HTools/Version.hs
321
HS_BUILT_SRCS_IN = $(patsubst %,%.in,$(HS_BUILT_SRCS))
322 322

  
323 323
$(RUN_IN_TEMPDIR): | $(all_dirfiles)
324 324

  
......
417 417
bin_SCRIPTS =
418 418
iallocators_SCRIPTS =
419 419
if WANT_HTOOLS
420
bin_SCRIPTS += $(filter-out htools/hail,$(HPROGS))
421
iallocators_SCRIPTS += $(filter htools/hail,$(HPROGS))
420
bin_SCRIPTS += $(filter-out htools/hail,$(HS_PROGS))
421
iallocators_SCRIPTS += $(filter htools/hail,$(HS_PROGS))
422 422
endif
423 423

  
424
$(HALLPROGS): %: %.hs $(HSRCS) $(HSRCS2) Makefile
424
$(HS_ALL_PROGS): %: %.hs $(HS_LIB_SRCS) $(HS_BUILT_SRCS) Makefile
425 425
	BINARY=$(@:htools/%=%); \
426 426
	$(GHC) --make \
427 427
	  $(HFLAGS) $(HEXTRA) $(HTOOLS_NOCURL) \
......
507 507
	$(maninput) \
508 508
	qa/qa-sample.json \
509 509
	$(qa_scripts) \
510
	$(HSRCS) $(HSRCS2IN) \
511
	$(HSRCPROGS)
510
	$(HS_LIB_SRCS) $(HS_BUILT_SRCS_IN) \
511
	$(HS_PROG_SRCS)
512 512

  
513 513
man_MANS = \
514 514
	man/ganeti.7 \
......
665 665
	test/ganeti-cleaner_unittest.bash \
666 666
	test/import-export_unittest.bash \
667 667
	$(all_python_code) \
668
	$(HSRCS) $(HSRCPROGS)
668
	$(HS_LIB_SRCS) $(HS_PROG_SRCS)
669 669

  
670 670
check_python_code = \
671 671
	$(BUILD_BASH_COMPLETION) \
......
945 945
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
946 946

  
947 947
.PHONY: hlint
948
hlint: $(HSRCS2)
948
hlint: $(HS_BUILT_SRCS)
949 949
	if tty -s; then C="-c"; else C=""; fi; \
950 950
	hlint --report=doc/hs-lint.html $$C htools
951 951

  
......
1021 1021
		--output $(CURDIR)/doc/py-apidoc
1022 1022

  
1023 1023
.PHONY: hs-apidoc
1024
hs-apidoc: $(HSRCS2)
1024
hs-apidoc: $(HS_BUILT_SRCS)
1025 1025
	@test -n "$(HSCOLOUR)" || \
1026 1026
	    { echo 'HsColour' not found during configure; exit 1; }
1027 1027
	@test -n "$(HADDOCK)" || \
......
1032 1032
	ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css
1033 1033
	set -e ; \
1034 1034
	cd htools; \
1035
	RELSRCS="$(HSRCS:htools/%=%)"; \
1035
	RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
1036 1036
	for file in $$RELSRCS; do \
1037 1037
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1038 1038
		$(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \
......
1041 1041
		-t ganeti-htools -p haddock-prologue \
1042 1042
		--source-module="%{MODULE/.//}.html" \
1043 1043
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
1044
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HSRCS:htools/%=%))
1044
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HS_LIB_SRCS:htools/%=%))
1045 1045

  
1046 1046
.PHONY: TAGS
1047 1047
TAGS: $(BUILT_SOURCES)
......
1083 1083
	rm -f .hpc; ln -s ../.hpc .hpc; \
1084 1084
	rm -f *.tix *.mix; \
1085 1085
	./live-test.sh; \
1086
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HPROGS:htools/%=%)) \
1086
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1087 1087
	  --output=live-test.tix ; \
1088 1088
	@mkdir_p@ ../doc/hs-coverage ; \
1089 1089
	hpc markup --destdir=../doc/hs-coverage live-test \

Also available in: Unified diff