2 # Copyright (c) 2020 Project nlbuild-autotools Authors. All Rights Reserved.
3 # Copyright (c) 2016 Nest Labs Inc. All Rights Reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 # This file is the GNU automake template for the @PACKAGE_DESCRIPTION@
21 # in-package, documentation.
24 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
27 $(srcdir)/Doxyfile.in \
31 # Override autotool's default notion of the package version variables.
32 # This ensures that when we create a doc distribution that the
33 # version is always the current version, not the version when the
34 # package was bootstrapped.
36 PACKAGE_VERSION = $(shell cat $(top_builddir)/.local-version)
37 VERSION = $(PACKAGE_VERSION)
42 @PACKAGE_SHORT_LOWER@_docdist_alias = \
43 $(PACKAGE_TARNAME)-docs
45 @PACKAGE_SHORT_LOWER@_docdist_name = \
46 $(@PACKAGE_SHORT_LOWER@_docdist_alias)-$(VERSION)
48 @PACKAGE_SHORT_LOWER@_docdist_archive = \
49 $(docdistdir)/$(@PACKAGE_SHORT_LOWER@_docdist_name).tar.gz
53 $(@PACKAGE_SHORT_LOWER@_docdist_archive) \
56 if @PACKAGE_SHORT_UPPER@_BUILD_DOCS
58 all-local: html/index.html
61 # We choose to manually transform Doxyfile.in into Doxyfile here in
62 # the makefile rather than in the configure script so that we can take
63 # advantage of live, at build time (rather than at configure time),
64 # updating of the package version number.
67 Doxyfile: $(srcdir)/Doxyfile.in Makefile
69 -e "s,\@DOXYGEN_USE_DOT\@,$(DOXYGEN_USE_DOT),g" \
70 -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
71 -e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
72 -e "s,\@PERL\@,$(PERL),g" \
73 -e "s,\@abs_builddir\@,$(abs_builddir),g" \
74 -e "s,\@abs_srcdir\@,$(abs_srcdir),g" \
75 -e "s,\@abs_top_builddir\@,$(abs_top_builddir),g" \
76 -e "s,\@abs_top_srcdir\@,$(abs_top_srcdir),g" \
77 < "$(srcdir)/Doxyfile.in" > "$(@)"
79 html/index.html: Doxyfile
80 $(AM_V_GEN)$(DOXYGEN) $(<)
83 # Addition rules and commands to create a documentation-only
84 # distribution of @PACKAGE_SHORT_LOWER@
87 $(@PACKAGE_SHORT_LOWER@_docdist_name): html/index.html
88 $(AM_V_at)rm -f -r $(@)
89 $(call create-directory)
90 $(AM_V_at)cp -R html $(@)
92 $(@PACKAGE_SHORT_LOWER@_docdist_archive): $(@PACKAGE_SHORT_LOWER@_docdist_name)
93 $(AM_V_at)echo " TAR $(@)"
94 $(AM_V_at)tardir="$(<)" && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c > "$(@)" && rm -rf $(<)
96 docdist $(@PACKAGE_SHORT_LOWER@_docdist_alias): $(@PACKAGE_SHORT_LOWER@_docdist_archive)
98 # Foreign make dependencies
100 NLFOREIGN_FILE_DEPENDENCIES = \
101 $(top_builddir)/.local-version \
104 Doxyfile $(@PACKAGE_SHORT_LOWER@_docdist_name) $(@PACKAGE_SHORT_LOWER@_docdist_archive): $(NLFOREIGN_FILE_DEPENDENCIES)
107 $(AM_V_at)rm -f -r html
109 endif # @PACKAGE_SHORT_UPPER@_BUILD_DOCS
111 include $(abs_top_nlbuild_autotools_dir)/automake/post.am