Revision a38bfce5 Makefile.am

b/Makefile.am
74 74

  
75 75
BUILDTIME_DIR_AUTOCREATE = \
76 76
	scripts \
77
	doc/api \
77
	doc/py-apidoc \
78
	$(HS_APIDOC) $(HS_APIDOC)/Ganeti $(HS_APIDOC)/Ganeti/HTools \
78 79
	doc/py-coverage \
79 80
	doc/hs-coverage \
80 81
	.hpc
......
290 291
HEXTRA =
291 292
# exclude options for coverage reports
292 293
HPCEXCL = --exclude Main --exclude Ganeti.HTools.QC
294
# directory for apidoc
295
HS_APIDOC = doc/hs-apidoc
293 296

  
294 297
HSRCS = \
295 298
	htools/Ganeti/HTools/CLI.hs \
......
999 1002
	@mkdir_p@ $* && touch $@
1000 1003

  
1001 1004
.PHONY: apidoc
1002
apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1005
if WANT_HTOOLSAPIDOC
1006
apidoc: py-apidoc hs-apidoc
1007
else
1008
apidoc: py-apidoc
1009
endif
1010

  
1011
.PHONY: py-apidoc
1012
py-apidoc: epydoc.conf $(RUN_IN_TEMPDIR) $(BUILT_SOURCES)
1003 1013
	$(RUN_IN_TEMPDIR) epydoc -v \
1004 1014
		--conf $(CURDIR)/epydoc.conf \
1005
		--output $(CURDIR)/doc/api
1015
		--output $(CURDIR)/doc/py-apidoc
1016

  
1017
.PHONY: hs-apidoc
1018
hs-apidoc: $(HSRCS2)
1019
	@test -n "$(HSCOLOUR)" || \
1020
	    { echo 'HsColour' not found during configure; exit 1; }
1021
	@test -n "$(HADDOCK)" || \
1022
	    { echo 'haddock' not found during configure; exit 1; }
1023
	rm -rf $(HS_APIDOC)/*
1024
	@mkdir_p@ $(HS_APIDOC)/Ganeti/HTools
1025
	$(HSCOLOUR) -print-css > $(HS_APIDOC)/Ganeti/hscolour.css
1026
	ln -s ../hscolour.css $(HS_APIDOC)/Ganeti/HTools/hscolour.css
1027
	set -e ; \
1028
	cd htools; \
1029
	RELSRCS="$(HSRCS:htools/%=%)"; \
1030
	for file in $$RELSRCS; do \
1031
		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
1032
		$(HSCOLOUR) -css -anchor $$file > ../$(HS_APIDOC)/$$hfile ; \
1033
	done ; \
1034
	$(HADDOCK) --odir ../$(HS_APIDOC) --html --ignore-all-exports -w \
1035
		-t ganeti-htools -p haddock-prologue \
1036
		--source-module="%{MODULE/.//}.html" \
1037
		--source-entity="%{MODULE/.//}.html#%{NAME}" \
1038
		$(filter-out Ganeti/HTools/ExtLoader.hs,$(HSRCS:htools/%=%))
1006 1039

  
1007 1040
.PHONY: TAGS
1008 1041
TAGS: $(BUILT_SOURCES)

Also available in: Unified diff