E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 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 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 25 | %.rst:: %.xfm man_list.im |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 26 | OUTPUT_TYPE=rst tfm $< | sed 's/^ //' >$@ |
| 27 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 28 | %.ps:: %.xfm man_list.im |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 29 | OUTPUT_TYPE=ps pfm $< $@ |
| 30 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 31 | %.txt:: %.xfm man_list.im |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 32 | OUTPUT_TYPE=txt tfm $< $@ |
| 33 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 34 | %.md:: %.xfm man_list.im |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 35 | OUTPUT_TYPE=markdown tfm $< | sed 's/^ //' >$@ |
| 36 | |
| 37 | docs = config-deploy developer-guide user-guide rel-notes overview |
| 38 | |
E. Scott Daniels | 190665f | 2019-12-09 09:05:22 -0500 | [diff] [blame] | 39 | all:: $(docs:%=%.rst) $(docs:%=%.txt) $(docs:%=%.md) |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 40 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 41 | man_list.im:: always |
| 42 | bash gen_man_list.sh >man_list.im |
| 43 | |
E. Scott Daniels | 190665f | 2019-12-09 09:05:22 -0500 | [diff] [blame] | 44 | rel-notes.xfm: ../../../CHANGES |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 45 | ksh fmt_changes.ksh >rel-notes.xfm |
| 46 | |
E. Scott Daniels | 4d1f9bf | 2020-03-06 12:29:28 -0500 | [diff] [blame^] | 47 | |
E. Scott Daniels | 190665f | 2019-12-09 09:05:22 -0500 | [diff] [blame] | 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 | |
| 56 | |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 57 | # copy the .rst files which have changed into the docs (plural) directory at the root of the repo |
| 58 | publish : $(docs:%=%.rst) |
| 59 | for f in *.rst;\ |
| 60 | do\ |
| 61 | if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\ |
| 62 | then\ |
| 63 | cp -p $$f ../../../docs/;\ |
| 64 | fi;\ |
| 65 | done |
| 66 | |
E. Scott Daniels | 190665f | 2019-12-09 09:05:22 -0500 | [diff] [blame] | 67 | # just list what would be published |
| 68 | verify : $(docs:%=%.rst) |
| 69 | for f in *.rst;\ |
| 70 | do\ |
| 71 | if ! diff -N -q $$f ../../../docs/$$f >/dev/null 2>&1;\ |
| 72 | then\ |
| 73 | echo "$$f would be published";\ |
| 74 | fi;\ |
| 75 | done |
| 76 | |
E. Scott Daniels | 392168d | 2019-11-06 15:12:38 -0500 | [diff] [blame] | 77 | # ditch any intermediate files |
| 78 | clean: |
| 79 | rm -f rel-notes.xfm *.sp *.ca |
| 80 | |
| 81 | # ditch anything that can be rebuilt |
| 82 | nuke: clean |
| 83 | rm -f *.ps *.pdf *.rst *.md |
| 84 | |
E. Scott Daniels | 190665f | 2019-12-09 09:05:22 -0500 | [diff] [blame] | 85 | # make hack to force a rule to always be out of date |
| 86 | always: |