Fix potential pointer use err in SI95
[ric-plt/lib/rmr.git] / doc / src / rtd / Makefile
1 # 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/^ //;  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
37 %.html:: %.xfm
38         OUTPUT_TYPE=html hfm $< $@
39
40 docs = config-deploy developer-guide rel-notes
41
42 all:: $(docs:%=%.rst) $(docs:%=%.txt) $(docs:%=%.md)
43
44 rel-notes.xfm:: always
45         ksh fmt_changes.ksh >rel-notes.xfm
46
47
48 # we force the docs to always be out of date so that we don't have to
49 # manage the list of man pages and other files that are read to generate the
50 # output needed for RTD.
51 #
52 $(docs:%=%.rst): always
53 $(docs:%=%.txt): always
54 $(docs:%=%.md): always
55 $(docs:%=%.html): always
56
57
58 # copy the .rst files which have changed into the docs (plural) directory at the root of the repo
59 publish : $(docs:%=%.rst)
60         bash publish_man.sh;\
61         bash publish_lib.sh;\
62         bash scrape_types.sh;\
63         for f in *.rst;\
64         do\
65                 if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
66                 then\
67                         sed 's/ *$$//' $$f >../../../docs/$${f##*/};\
68                 fi;\
69         done
70
71 # just list what would be published
72 verify : $(docs:%=%.rst)
73         for f in *.rst;\
74         do\
75                 if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\
76                 then\
77                         echo "$$f would be published";\
78                 fi;\
79         done
80
81 test:
82         bash publish_lib.sh;
83
84 # ditch any intermediate files
85 clean:
86         rm -f rel-notes.xfm *.sp *.ca
87
88 # ditch anything that can be rebuilt
89 nuke: clean
90         rm -f *.ps *.pdf *.rst *.md *.txt
91
92 # make hack to force a rule to always be out of date
93 always: