bd0410a31c6e6a57643c5f088a737d6228164257
Lunar Import build system from pr...

Lunar authored 10 years ago

1) @YELP_HELP_RULES@
2) 
Lunar Add half-working PDF build...

Lunar authored 10 years ago

3) # XXX: turn into ./configure option
4) MAL2LATEX = ../mal2latex
Lunar Import build system from pr...

Lunar authored 10 years ago

5) HELP_ID = tor-browser-user-manual
6) HELP_FILES = $(shell cd C && git ls-files '*.page')
7) HELP_MEDIA = $(shell cd C && git ls-files 'media')
8) HELP_PLATFORMS = windows macosx linux
9) HELP_LINGUAS = ar de es fa fr it ko nl pl pt_PT ru tr vi zh_CN
10) 
11) .PHONY: html
Lunar Add half-working PDF build...

Lunar authored 10 years ago

12) html: all media-symlinks.stamp
Lunar Import build system from pr...

Lunar authored 10 years ago

13) 	set -e && \
14) 		for lc in C $(HELP_LINGUAS); do \
15) 			for platform in $(HELP_PLATFORMS); do \
16) 				mkdir -p html/$$platform/$$lc; \
17) 				yelp-build html -x platform-$$platform.xslt \
18) 						-o html/$$platform/$$lc $$lc; \
19) 			done; \
Lunar Add half-working PDF build...

Lunar authored 10 years ago

20) 		done
21) 
22) .PHONY: pdf
23) pdf: all media-symlinks.stamp
24) 	set -e && \
25) 		for lc in C $(HELP_LINGUAS); do \
26) 			for platform in $(HELP_PLATFORMS); do \
27) 				PDF_DIR=pdf/$$platform/$$lc; \
28) 				LATEX_FILE=$(HELP_ID)-$$lc.latex; \
29) 				mkdir -p $$PDF_DIR; \
30) 				yelp-build cache -o $$PDF_DIR/index.cache $$lc; \
31) 				xsltproc --xinclude \
32) 					$(MAL2LATEX)/mal2latex.xsl $$PDF_DIR/index.cache \
33) 					> $$PDF_DIR/$$LATEX_FILE; \
34) 				(cd $$PDF_DIR && lualatex $$LATEX_FILE); \
35) 			done; \
Lunar Import build system from pr...

Lunar authored 10 years ago

36) 		done;
37) 
Lunar Add half-working PDF build...

Lunar authored 10 years ago

38) media-symlinks.stamp: all
39) 	set -e && \
40) 		for lc in C $(HELP_LINGUAS); do \
41) 			for media in $(HELP_MEDIA); do \
42) 				if ! [ -f $$lc/$$media ]; then \
43) 					mkdir -p $$(dirname $$lc/$$media); \
44) 					ln -nsf ../../C/$$media $$lc/$$media; \
45) 				fi; \
46) 			done; \
47) 		done
48) 	touch media-symlinks.stamp
49) 
Lunar Import build system from pr...

Lunar authored 10 years ago

50) clean:
51) 	set -e && \
52) 		for lc in C $(HELP_LINGUAS); do \
53) 			for media in $(HELP_MEDIA); do \
54) 				if [ -L $$lc/$$media ]; then \
55) 					rm $$lc/$$media; \
56) 				fi; \
57) 				rmdir --ignore-fail-on-non-empty $$(dirname $$lc/$$media); \
58) 			done; \
59) 		done;
60) 
61) distclean-local:
62) 	rm -rf html