File: Makefile

package info (click to toggle)
pasdoc 0.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 33,536 kB
  • sloc: pascal: 28,894; javascript: 7,665; xml: 2,597; makefile: 519; sh: 417
file content (144 lines) | stat: -rw-r--r-- 4,826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# This Makefile creates PasDoc generated documentation for PasDoc itself.
# Documentation is created in subdirectories named after pasdoc's --format
# names (html/, latex/ etc.)
#
# Targets:
#
#   html latex pdf dvi ps html-latex htmlhelp rtf
#     Make documentation in requested format.
#
#   clean
#     Delete all generated documentation.
#
#   public
#     Generate documentation in all formats that we want to show
#     on https://pasdoc.github.io/autodoc/ .
#
#   upload
#     Copy documentation generated by `public'
#     to ../../../pasdoc.github.io/docs/ .
#     This assumes you have cloned
#     https://github.com/pasdoc/pasdoc.github.io alongside pasdoc repo.
#     After pushing this repo it will be visible on
#     https://pasdoc.github.io/autodoc/ .
#
# Some hints:
#   To completely remake all documentation for
#   https://pasdoc.github.io/autodoc/
#   just call `make clean public upload'
#   then in ../../../pasdoc.github.io/ to GIT commit + push with new docs.

# Making documentation ----------------------------------------

# Name of pasdoc binary. Remember that you can override it at
# make's command-line, like `make PASDOC=my_pasdoc'
PASDOC=pasdoc

# These options will be passed to every pasdoc invocation,
# i.e. for every output format.
PASDOC_OPTIONS=--include ../component \
  ../component/*.pas ../component/tipue/*.pas \
  ../console/*.pas \
  -DFPC -DVER2 -DPASDOC \
  --title "PasDoc's autodoc" --write-uses-list  --auto-abstract \
  --introduction=introduction.txt

GRAPHVIZ_COMMANDS=dot -Grankdir=LR -Tjpg -oGVClasses.jpg GVClasses.dot; \
                  dot -Grankdir=LR -Tjpg -oGVUses.jpg GVUses.dot

# These options will be passed only when making docs in format that
# supports including graphviz graphs.
PASDOC_GRAPHVIZ_OPTIONS=--graphviz-classes --graphviz-uses \
  --link-gv-classes jpg --link-gv-uses jpg

# How to call hhc (html help compiler) ?
# Default value means that it must be available on path.
# As usual, remember you can override it at make's command-line.
HHC=hhc

.PHONY: html latex pdf dvi ps html-latex clean htmlhelp rtf

html:
	mkdir -p html/
	$(PASDOC) $(PASDOC_OPTIONS) $(PASDOC_GRAPHVIZ_OPTIONS) \
	  --output=html/ --use-tipue-search
	cd html/; $(GRAPHVIZ_COMMANDS)

# Ignore exit code from hhc (it's always 1 ???)
htmlhelp:
	mkdir -p htmlhelp/
	$(PASDOC) $(PASDOC_OPTIONS) $(PASDOC_GRAPHVIZ_OPTIONS) \
	  --format=htmlhelp --output=htmlhelp/
	cd htmlhelp/; $(GRAPHVIZ_COMMANDS)
	-cd htmlhelp/; $(HHC) docs.hhp

# Just shortcuts
latex: latex/docs.tex
pdf: latex/docs.pdf
dvi: latex/docs.dvi
ps: latex/docs.ps
html-latex: latex/docs.html
rtf: latex2rtf/docs.rtf

latex/docs.tex:
	mkdir -p latex/
	$(PASDOC) $(PASDOC_OPTIONS) \
	  --format=latex --output=latex/

# (Yes, I must do `cd latex' before calling pdflatex, I can't simply call
# `pdflatex latex/docs.tex' because then many output files of pdflatex
# would be placed in current dir)
latex/docs.pdf: latex/docs.tex
	cd latex; pdflatex --file-line-error-style -interaction=nonstopmode docs.tex
	cd latex; pdflatex --file-line-error-style -interaction=nonstopmode docs.tex

latex/docs.dvi: latex/docs.tex
	cd latex; latex --file-line-error-style -interaction=nonstopmode docs.tex
	cd latex; latex --file-line-error-style -interaction=nonstopmode docs.tex

latex/docs.ps: latex/docs.dvi
	cd latex; dvips docs.dvi -o docs.ps

# When working htlatex overrides latex/docs.dvi with a version
# that is not really a useful to browse (it's only for htlatex internals).
# That's why I `rm' it afterwards.
#
# As far as I understand how htlatex works, it's not needed to run
# htlatex twice (like it's needed with pdflatex and latex).
latex/docs.html: latex/docs.tex
	cd latex; htlatex docs.tex
	rm latex/docs.dvi

latex2rtf/docs.tex:
	mkdir -p latex2rtf/
	$(PASDOC) $(PASDOC_OPTIONS) \
	  --format=latex2rtf --output=latex2rtf/

# I must have latex/docs.tex as a prerequisite, to run latex over it
# to generate docs.aux file. Then I can use latex/docs.aux file with latex2rtf
# so that latex2rtf can make appropriate links.
latex2rtf/docs.rtf: latex2rtf/docs.tex latex/docs.tex
	cd latex/; latex --file-line-error-style -interaction=nonstopmode docs.tex
	cd latex2rtf/; latex2rtf -a ../latex/docs.aux docs.tex

clean:
	rm -Rf html/ latex/ latex2rtf/ htmlhelp/ html_by_pasdoc_gui/

# ------------------------------------------------------------
# Making and uploading autodoc for https://pasdoc.github.io/autodoc/

.PHONY:	public upload

public: html pdf latex

OUTPUT_DIR:=../../../pasdoc.github.io/docs/
AUTODOC_DIR:=$(OUTPUT_DIR)autodoc/

upload:
	rm -Rf $(AUTODOC_DIR)
	mkdir -p $(AUTODOC_DIR) $(AUTODOC_DIR)latex/
	cp -Rf html/ $(AUTODOC_DIR)
	cp -Rf latex/docs.pdf $(AUTODOC_DIR)latex/
	cp -Rf latex/docs.tex $(AUTODOC_DIR)latex/

# eof ------------------------------------------------------------