Debian Codegraph @

Makefile

raw
1 # you can override on command line
2 lang = en
3
4 define run-in-docker =
5 docker run --rm -v $$(pwd):/home/makedoc/linbit-documentation linbit-documentation /bin/sh -c 'cd ~/linbit-documentation && make $(patsubst %-docker,%,$@) lang=$(lang)'
6 endef
7
8 .PHONY: README.html-docker
9 README.html: README.adoc
10 asciidoctor -n -o $@ $<
11
12 README.html-docker: dockerimage
13 $(run-in-docker)
14
15 #
16 # po4a v0.54 is required to make build ja adoc files.
17 #
18 define dockerfile=
19 FROM debian:buster
20 MAINTAINER Roland Kammerer <[email protected]>
21 ADD /GNUmakefile /linbit-documentation/GNUmakefile
22 RUN groupadd --gid $(shell id -g) makedoc
23 RUN useradd -m -u $(shell id -u) -g $(shell id -g) makedoc
24 RUN apt-get update && apt-get install -y make inkscape ruby po4a patch openssh-client lftp curl unzip
25 RUN gem install --pre asciidoctor-pdf
26 RUN gem install --pre asciidoctor-pdf-cjk
27 RUN gem install asciidoctor-pdf-cjk-kai_gen_gothic && asciidoctor-pdf-cjk-kai_gen_gothic-install
28 RUN curl https://packages.linbit.com/public/genshingothic-20150607.zip > /tmp/ja.zip && (mkdir /linbit-documentation/genshingothic-fonts && cd /linbit-documentation/genshingothic-fonts && unzip /tmp/ja.zip); rm /tmp/ja.zip
29 USER makedoc
30 RUN mkdir /home/makedoc/.ssh && chmod 700 /home/makedoc/.ssh && ssh-keygen -f /home/makedoc/.ssh/id_rsa -t rsa -N '' && cat /home/makedoc/.ssh/id_rsa.pub
31 endef
32
33 export dockerfile
34 Dockerfile:
35 @echo "$$dockerfile" > $@
36
37 .PHONY: dockerimage
38 dockerimage: Dockerfile
39 if ! docker images --format={{.Repository}}:{{.Tag}} | grep -q 'linbit-documentation:latest'; then \
40 test -f GNUmakefile || echo 'include Makefile' > GNUmakefile ; \
41 docker build -t linbit-documentation . ; \
42 fi
43
44 # UG 9
45 .PHONY: UG9-pdf-finalize UG9-pdf-finalize-docker UG9-html-finalize UG9-html-finalize-docker UG9-pot UG9-pot-docker
46 UG9-pdf-finalize:
47 make -C UG9 pdf-finalize lang=$(lang)
48
49 UG9-pdf-finalize-docker: dockerimage
50 $(run-in-docker)
51
52 UG9-html-finalize:
53 make -C UG9 html-finalize lang=$(lang)
54
55 UG9-html-finalize-docker: dockerimage
56 $(run-in-docker)
57
58 UG9-pot:
59 make -C UG9 pot lang=en
60
61 UG9-pot-docker: dockerimage
62 $(run-in-docker)
63
64 # UG 8.4
65 .PHONY: UG8.4-pdf-finalize UG8.4-pdf-finalize-docker UG8.4-html-finalize UG8.4-html-finalize-docker UG8.4-pot UG8.4-pot-docker
66 UG8.4-pdf-finalize:
67 make -C UG8.4 pdf-finalize lang=$(lang)
68
69 UG8.4-pdf-finalize-docker: dockerimage
70 $(run-in-docker)
71
72 UG8.4-html-finalize:
73 make -C UG8.4 html-finalize lang=$(lang)
74
75 UG8.4-html-finalize-docker: dockerimage
76 $(run-in-docker)
77
78 UG8.4-pot:
79 make -C UG8.4 pot lang=en
80
81 UG8.4-pot-docker: dockerimage
82 $(run-in-docker)
83
84 ## targets you can only use if you cloned the according *private* project
85 # tech guides
86 .PHONY: tech-guides-pdf-finalize tech-guides-pdf-finalize-docker
87 tech-guides-pdf-finalize:
88 make -C tech-guides pdf-finalize
89
90 tech-guides-pdf-finalize-docker: dockerimage
91 $(run-in-docker)
92
93 .PHONY: clean clean-all
94 clean:
95 $(warning this target is reserved, maybe you look for clean-all)
96
97 clean-all:
98 make -C UG8.4 clean-all
99 make -C UG9 clean-all