blob: a714e6ac10db9b2b507990a36a2bbe6edd6274b9 [file] [log] [blame]
E. Scott Daniels392168d2019-11-06 15:12:38 -05001# vim: ts=4 noet sw=4:
2#==================================================================================
3# Copyright (c) 2019 Nokia
4# Copyright (c) 2018-2019 AT&T Intellectual Property.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#==================================================================================
18
19# This is a stand-alone make file as the RTD documentation is NOT built and packaged
20# with the normal CMake process and thus isn't covered in the CMake files.
21
22# {X}fm is required to compile the source.
23
24
25%.rst:: %.xfm
26 OUTPUT_TYPE=rst tfm $< | sed 's/^ //' >$@
27
28%.ps:: %.xfm
29 OUTPUT_TYPE=ps pfm $< $@
30
31%.txt:: %.xfm
32 OUTPUT_TYPE=txt tfm $< $@
33
34%.md:: %.xfm
35 OUTPUT_TYPE=markdown tfm $< | sed 's/^ //' >$@
36
37docs = config-deploy developer-guide user-guide rel-notes overview
38
E. Scott Daniels190665f2019-12-09 09:05:22 -050039all:: $(docs:%=%.rst) $(docs:%=%.txt) $(docs:%=%.md)
E. Scott Daniels392168d2019-11-06 15:12:38 -050040
E. Scott Daniels190665f2019-12-09 09:05:22 -050041rel-notes.xfm: ../../../CHANGES
E. Scott Daniels392168d2019-11-06 15:12:38 -050042 ksh fmt_changes.ksh >rel-notes.xfm
43
E. Scott Daniels190665f2019-12-09 09:05:22 -050044# we force the docs to always be out of date so that we don't have to
45# manage the list of man pages and other files that are read to generate the
46# output needed for RTD.
47#
48$(docs:%=%.rst): always
49$(docs:%=%.txt): always
50$(docs:%=%.md): always
51
52
E. Scott Daniels392168d2019-11-06 15:12:38 -050053# copy the .rst files which have changed into the docs (plural) directory at the root of the repo
54publish : $(docs:%=%.rst)
55 for f in *.rst;\
56 do\
57 if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
58 then\
59 cp -p $$f ../../../docs/;\
60 fi;\
61 done
62
E. Scott Daniels190665f2019-12-09 09:05:22 -050063# just list what would be published
64verify : $(docs:%=%.rst)
65 for f in *.rst;\
66 do\
67 if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
68 then\
69 echo "$$f would be published";\
70 fi;\
71 done
72
E. Scott Daniels392168d2019-11-06 15:12:38 -050073# ditch any intermediate files
74clean:
75 rm -f rel-notes.xfm *.sp *.ca
76
77# ditch anything that can be rebuilt
78nuke: clean
79 rm -f *.ps *.pdf *.rst *.md
80
E. Scott Daniels190665f2019-12-09 09:05:22 -050081# make hack to force a rule to always be out of date
82always: