2 # Copyright 2015-2017 Nest Labs Inc. All Rights Reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 # This file is the GNU automake template for the Nest Labs Unit
20 # Test, in-package, documentation.
23 include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
26 $(srcdir)/Doxyfile.in \
30 # Override autotool's default notion of the package version variables.
31 # This ensures that when we create a doc distribution that the
32 # version is always the current version, not the version when the
33 # package was bootstrapped.
35 PACKAGE_VERSION = $(shell cat $(top_builddir)/.local-version)
36 VERSION = $(PACKAGE_VERSION)
41 nlunit_test_docdist_alias = \
42 $(PACKAGE_TARNAME)-docs
44 nlunit_test_docdist_name = \
45 $(nlunit_test_docdist_alias)-$(VERSION)
47 nlunit_test_docdist_archive = \
48 $(docdistdir)/$(nlunit_test_docdist_name).tar.gz
52 $(nlunit_test_docdist_archive) \
55 if NLUNIT_TEST_BUILD_DOCS
57 all-local: html/index.html
60 # We choose to manually transform Doxyfile.in into Doxyfile here in
61 # the makefile rather than in the configure script so that we can take
62 # advantage of live, at build time (rather than at configure time),
63 # updating of the package version number.
66 Doxyfile: $(srcdir)/Doxyfile.in Makefile
68 -e "s,\@DOXYGEN_USE_DOT\@,$(DOXYGEN_USE_DOT),g" \
69 -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
70 -e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
71 -e "s,\@PERL\@,$(PERL),g" \
72 -e "s,\@abs_builddir\@,$(abs_builddir),g" \
73 -e "s,\@abs_srcdir\@,$(abs_srcdir),g" \
74 -e "s,\@abs_top_builddir\@,$(abs_top_builddir),g" \
75 -e "s,\@abs_top_srcdir\@,$(abs_top_srcdir),g" \
76 < "$(srcdir)/Doxyfile.in" > "$(@)"
78 html/index.html: Doxyfile
79 $(AM_V_GEN)$(DOXYGEN) $(<)
82 # Addition rules and commands to create a documentation-only
83 # distribution of nlunit-test
86 $(nlunit_test_docdist_name): html/index.html
87 $(AM_V_at)rm -f -r $(@)
88 $(call create-directory)
89 $(AM_V_at)cp -R html $(@)
91 $(nlunit_test_docdist_archive): $(nlunit_test_docdist_name)
92 $(AM_V_at)echo " TAR $(@)"
93 $(AM_V_at)tardir="$(<)" && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c > "$(@)" && rm -rf $(<)
95 docdist $(nlunit_test_docdist_alias): $(nlunit_test_docdist_archive)
98 $(AM_V_at)rm -f -r html
100 endif # NLUNIT_TEST_BUILD_DOCS
102 include $(abs_top_nlbuild_autotools_dir)/automake/post.am