ovcc-valadoc.make 2.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
if ENABLE_VALADOC


# Variables the user should set (some have sensible defaults, but the user
# should probably check them)
VALADOC_MODULE_NAME     ?=
VALADOC_MODULE_VERSION  ?= @VERSION@
VALADOC_SRCDIR          ?= $(top_srcdir)/$(PACKAGE)
VALADOC_FILES           ?= $(wildcard $(VALADOC_SRCDIR)/*.vala)
VALADOC_FLAGS           ?=
VALADOC_LIB             ?=
VALADOC_CHEADER         ?= $(VALADOC_SRCDIR)/$(PACKAGE).h

valadoc_real_flags      = --no-protected \
                          --vapidir $(VALADOC_SRCDIR) \
                          -b $(VALADOC_SRCDIR) \
                          $(VALADOC_FLAGS) \
                          --package-name $(VALADOC_MODULE_NAME) \
                          --package-version $(VALADOC_MODULE_VERSION) \
                          $(VALADOC_FILES)

22
EXTRA_DIST = valadoc devhelp gtkdoc
23

24 25
doc: valadoc devhelp gtkdoc
dist-hook: valadoc devhelp gtkdoc
26

27 28 29 30 31 32
# Removing the target before building the documentation avoids conflicts
# between doclet and directory names, since valadoc first tries to find the
# doclet in the current directory.
# For the gtkdoc doclet, it also prevents leftover files to be used and
# produce wrong results, e.g. if a file got renamed.

33 34 35
valadoc: $(VALADOC_FILES)
	$(AM_V_at)$(RM) -r $@
	$(AM_V_GEN)$(VALADOC) \
36 37 38 39 40
		-o $@ \
		--doclet html \
		$(valadoc_real_flags)

devhelp: $(VALADOC_FILES)
41 42
	$(AM_V_at)$(RM) -r $@
	$(AM_V_GEN)$(VALADOC) \
43 44 45 46
		-o $@ \
		--doclet devhelp \
		$(valadoc_real_flags)

47
if ENABLE_VALADOC_GTKDOC
48
gtkdoc: $(VALADOC_FILES)
49 50
	$(AM_V_at)$(RM) -r $@
	$(AM_V_GEN)$(VALADOC) \
51 52 53 54 55
		-X -l -X $(VALADOC_LIB) \
		-X $(VALADOC_CHEADER) \
		-o $@ \
		--doclet gtkdoc \
		$(valadoc_real_flags)
56 57 58 59
else
gtkdoc:
	$(AM_V_at)mkdir $@
endif
60 61 62


clean-local:
63
	$(RM) -r valadoc devhelp gtkdoc
64 65 66 67 68 69 70 71 72

uninstall-doc-devhelp:
	$(RM) -r $(DESTDIR)$(datadir)/devhelp/books/$(VALADOC_MODULE_NAME)

install-doc-devhelp: devhelp
	$(MKDIR_P) $(DESTDIR)$(datadir)/devhelp/books/$(VALADOC_MODULE_NAME)/img
	$(INSTALL_DATA) -t $(DESTDIR)$(datadir)/devhelp/books/$(VALADOC_MODULE_NAME) devhelp/$(VALADOC_MODULE_NAME)/*.*
	$(INSTALL_DATA) -t $(DESTDIR)$(datadir)/devhelp/books/$(VALADOC_MODULE_NAME)/img devhelp/$(VALADOC_MODULE_NAME)/img/*

73
if ENABLE_VALADOC_GTKDOC
74 75
uninstall-doc-gtkdoc:
	$(RM) -r $(DESTDIR)$(datadir)/gtk-doc/html/$(VALADOC_MODULE_NAME)
76 77 78
else
uninstall-doc-gtkdoc:
endif
79

80
if ENABLE_VALADOC_GTKDOC
81 82 83
install-doc-gtkdoc: gtkdoc
	$(MKDIR_P) $(DESTDIR)$(datadir)/gtk-doc/html/$(VALADOC_MODULE_NAME)
	$(INSTALL_DATA) -t $(DESTDIR)$(datadir)/gtk-doc/html/$(VALADOC_MODULE_NAME) gtkdoc/html/*.*
84 85 86
else
install-doc-gtkdoc:
endif
87 88 89 90 91 92 93 94 95

uninstall-hook: uninstall-doc-devhelp uninstall-doc-gtkdoc

install-data-hook: install-doc-devhelp install-doc-gtkdoc


.PHONY: uninstall-doc-devhelp \
        install-doc-devhelp \
        uninstall-doc-gtkdoc \
96 97
        install-doc-gtkdoc \
        doc
98 99 100


endif