Revision 22c5390d Makefile.am

b/Makefile.am
22 22
DOCPP = $(top_srcdir)/autotools/docpp
23 23
REPLACE_VARS_SED = autotools/replace_vars.sed
24 24

  
25
# Note: the variable must be named after the directory + 'dir' suffix
25
# Note: these are automake-specific variables, and must be named after
26
# the directory + 'dir' suffix
26 27
clientdir = $(pkgpythondir)/client
27 28
hypervisordir = $(pkgpythondir)/hypervisor
28 29
httpdir = $(pkgpythondir)/http
......
74 75

  
75 76
BUILDTIME_DIR_AUTOCREATE = \
76 77
	scripts \
77
	doc/py-apidoc \
78
	$(HS_APIDOC) $(HS_APIDOC)/Ganeti $(HS_APIDOC)/Ganeti/HTools \
79
	doc/py-coverage \
80
	doc/hs-coverage \
78
	$(APIDOC_DIR) \
79
	$(APIDOC_PY_DIR) \
80
	$(APIDOC_HS_DIR) \
81
	$(APIDOC_HS_DIR)/Ganeti $(APIDOC_HS_DIR)/Ganeti/HTools \
82
	$(COVERAGE_DIR) \
83
	$(COVERAGE_PY_DIR) \
84
	$(COVERAGE_HS_DIR) \
81 85
	.hpc
82 86

  
83 87
BUILDTIME_DIRS = \
......
91 95

  
92 96
all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
93 97

  
98
# some helper vars
99
COVERAGE_DIR = doc/coverage
100
COVERAGE_PY_DIR = $(COVERAGE_DIR)/py
101
COVERAGE_HS_DIR = $(COVERAGE_DIR)/hs
102
APIDOC_DIR = doc/api
103
APIDOC_PY_DIR = $(APIDOC_DIR)/py
104
APIDOC_HS_DIR = $(APIDOC_DIR)/hs
105

  
94 106
MAINTAINERCLEANFILES = \
95 107
	$(docpng) \
96 108
	$(maninput) \
......
292 304
HEXTRA =
293 305
# exclude options for coverage reports
294 306
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
295
# directory for apidoc
296
HS_APIDOC = doc/hs-apidoc
297 307

  
298 308
HS_LIB_SRCS = \
299 309
	htools/Ganeti/HTools/CLI.hs \
......
1018 1028
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1019 1029
	$(RUN_IN_TEMPDIR) epydoc -v \
1020 1030
		--conf $(CURDIR)/epydoc.conf \
1021
		--output $(CURDIR)/doc/py-apidoc
1031
		--output $(CURDIR)/$(APIDOC_PY_DIR)
1022 1032

  
1023 1033
.PHONY: hs-apidoc
1024 1034
hs-apidoc: $(HS_BUILT_SRCS)
......
1026 1036
	    { echo 'HsColour' not found during configure; exit 1; }
1027 1037
	@test -n "$(HADDOCK)" || \
1028 1038
	    { echo 'haddock' not found during configure; exit 1; }
1029
	rm -rf $(HS_APIDOC)/*
1030
	@mkdir_p@ $(HS_APIDOC)/Ganeti/HTools
1031
	$(HSCOLOUR) -print-css > $(HS_APIDOC)/Ganeti/hscolour.css
1032
	ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css
1039
	rm -rf $(APIDOC_HS_DIR)/*
1040
	@mkdir_p@ $(APIDOC_HS_DIR)/Ganeti/HTools
1041
	$(HSCOLOUR) -print-css > $(APIDOC_HS_DIR)/Ganeti/hscolour.css
1042
	ln -s ../hscolour.css $(APIDOC_HS_DIR)/Ganeti/HTools/hscolour.css
1033 1043
	set -e ; \
1034 1044
	cd htools; \
1035 1045
	RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
1036 1046
	for file in $$RELSRCS; do \
1037 1047
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1038
		$(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \
1048
		$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ; \
1039 1049
	done ; \
1040
	$(HADDOCK) --odir ../$(HS_APIDOC) --html --ignore-all-exports -w \
1050
	$(HADDOCK) --odir ../$(APIDOC_HS_DIR) --html --ignore-all-exports -w \
1041 1051
		-t ganeti-htools -p haddock-prologue \
1042 1052
		--source-module="%{MODULE/.//}.html" \
1043 1053
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
......
1061 1071
.PHONY: py-coverage
1062 1072
py-coverage: $(BUILT_SOURCES) $(python_tests)
1063 1073
	set -e; \
1064
	COVERAGE_FILE=$(CURDIR)/doc/py-coverage/data \
1065
	TEXT_COVERAGE=$(CURDIR)/doc/py-coverage/report.txt \
1066
	HTML_COVERAGE=$(CURDIR)/doc/py-coverage \
1074
	COVERAGE_FILE=$(CURDIR)/$(COVERAGE_PY_DIR)/data \
1075
	TEXT_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR)/report.txt \
1076
	HTML_COVERAGE=$(CURDIR)/$(COVERAGE_PY_DIR) \
1067 1077
	$(PLAIN_TESTS_ENVIRONMENT) $(abs_top_srcdir)/autotools/gen-coverage \
1068 1078
	$(python_tests)
1069 1079

  
1070 1080
.PHONY: hs-coverage
1071 1081
hs-coverage: $(haskell_tests)
1072 1082
	cd htools && rm -f *.tix *.mix && ./test
1073
	mkdir -p doc/hs-coverage
1074
	hpc markup --destdir=doc/hs-coverage htools/test $(HPCEXCL)
1083
	mkdir -p $(COVERAGE_HS_DIR)
1084
	hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL)
1075 1085
	hpc report htools/test $(HPCEXCL)
1076 1086

  
1077 1087
# Special "kind-of-QA" target for htools, needs special setup (all
......
1085 1095
	./live-test.sh; \
1086 1096
	hpc sum --union $(HPCEXCL) $(addsuffix .tix,$(HS_PROGS:htools/%=%)) \
1087 1097
	  --output=live-test.tix ; \
1088
	@mkdir_p@ ../doc/hs-coverage ; \
1089
	hpc markup --destdir=../doc/hs-coverage live-test \
1098
	@mkdir_p@ ../$(COVERAGE_HS_DIR) ; \
1099
	hpc markup --destdir=../$(COVERAGE_HS_DIR) live-test \
1090 1100
		--srcdir=.. $(HPCEXCL) ; \
1091 1101
	hpc report --srcdir=.. live-test $(HPCEXCL)
1092 1102

  

Also available in: Unified diff