1 #==================================================================================
2 # Copyright (c) 2019 Nokia
3 # Copyright (c) 2018-2019 AT&T Intellectual Property.
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.
16 #==================================================================================
18 # most things here require a two pass build, but these might be useful
24 OUTPUT_TYPE=markdown tfm $< stdout | sed 's/^ //' >$@
27 OUTPUT_TYPE=rst tfm $< stdout | sed 's/^ //' >$@
30 OUTPUT_TYPE=txt tfm $< stdout
31 OUTPUT_TYPE=txt tfm $< $@
34 gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
37 src = user.xfm advanced_use.im api_qref.im code_appendix.im code_send.im config.im failures.im general_use.im glossary.im index_snatch.im setup.im mbuf.im front_junk.im license.im
38 code_src = $(shell ls code_*.im)
40 all: user.pdf user.txt user.rst user.md
42 # two pass build for pfm to allow for toc insertion
43 user.ps: $(src) $(code_src)
44 XFM_PASS=1 pfm $< /dev/null
47 user.md: $(src) $(code_src)
48 OUTPUT_TYPE=markdown XFM_PASS=1 tfm $< /dev/null
49 OUTPUT_TYPE=markdown XFM_PASS=2 tfm $< | sed 's/^ //' >$@
51 user.rst: $(src) $(code_src)
52 OUTPUT_TYPE=rst XFM_PASS=1 tfm $< /dev/null
53 GEN_TITLE=1 OUTPUT_TYPE=rst XFM_PASS=2 tfm $< | sed 's/^ //' >$@
55 user.txt: $(src) $(code_src)
56 OUTPUT_TYPE=txt XFM_PASS=1 tfm $< /dev/null
57 OUTPUT_TYPE=txt XFM_PASS=2 tfm $< $@
59 # intermeidate junk that might straggle
61 rm -fr *.bcnfile *.ca *.ecnfile
63 # Anything that can be built
65 rm -fr *.ps *.pdf *.txt *.rst