-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinclude.in
102 lines (82 loc) · 3.9 KB
/
include.in
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
HTMLDIRSYSV_MLANG := html-MLANG-sysv
HTMLDIRSYSD_MLANG := html-MLANG-systemd
HTMLTARSYSV_MLANG := LFS-SYSV-BOOK-$(MILESTONE)-MLANG-HTML.tar.bz2
HTMLTARSYSD_MLANG := LFS-SYSD-BOOK-$(MILESTONE)-MLANG-HTML.tar.bz2
PDFSYSV_MLANG := LFS-SYSV-BOOK-$(MILESTONE)-MLANG.pdf
PDFSYSD_MLANG := LFS-SYSD-BOOK-$(MILESTONE)-MLANG.pdf
EPUBSYSV_MLANG := LFS-SYSV-BOOK-$(MILESTONE)-MLANG.epub
EPUBSYSD_MLANG := LFS-SYSD-BOOK-$(MILESTONE)-MLANG.epub
XML_MLANG := $(shell find $(ORIGDIR) -name '*.xml' -o -name '*stylesheets*' -prune -a -type f | sed "s|$(ORIGDIR)/|lfsgen-MLANG/|g" | tr '\n' ' ')
PO_MLANG := $(shell find $(ORIGDIR) -name '*.xml' -o -name '*stylesheets*' -prune -a -type f | sed "s|$(ORIGDIR)/|MLANG/|g" | sed 's|.xml$$|.po|' | tr '\n' ' ')
PO += $(PO_MLANG)
IMAGES_MLANG := $(shell find images -type f | sed "s|^|lfsgen-MLANG/|g" | tr '\n' ' ')
STYLESHEETS_MLANG := $(shell find stylesheets -type f | sed "s|^|lfsgen-MLANG/|g" | tr '\n' ' ')
COPY_MLANG := $(addprefix lfsgen-MLANG/,$(filestoget))
lfsgen-MLANG/images/%: images/%
mkdir -p $$(dirname $@)
@rm -f $@
cp $< $@
lfsgen-MLANG/stylesheets/%: stylesheets/%
mkdir -p $$(dirname $@)
@rm -f $@
cp $< $@
lfsgen-MLANG/%.xml: $(ORIGDIR)/%.xml MLANG/%.po sed-MLANG
mkdir -p $$(dirname $@)
LANG=$(LANG_MLANG) po4a-translate -k 0 -f docbook -m $< -l [email protected] -p $(word 2,$^)
./$(word 3,$^) $@
MLANG/%.po: $(ORIGDIR)/%.xml
mkdir -p $$(dirname $@)
LANG=$(LANG_MLANG) po4a-updatepo -f docbook -m $< -p $@
python3 set-xml.py $@
@touch $@
clean-gen-MLANG:
rm -rf lfsgen-MLANG
clean-product-MLANG:
rm -rf $(HTMLTARSYSV_MLANG)
rm -rf $(HTMLTARSYSD_MLANG)
rm -rf $(HTMLDIRSYSV_MLANG)
rm -rf $(HTMLDIRSYSD_MLANG)
rm -rf $(PDFSYSV_MLANG)
rm -rf $(PDFSYSD_MLANG)
rm -rf $(EPUBSYSV_MLANG)
rm -rf $(EPUBSYSD_MLANG)
.SECONDEXPANSION:
$(addprefix lfsgen-MLANG/,$(filestocopy)): INPUT=$(ORIGDIR)$(subst lfsgen-MLANG,,$@)
$(addprefix lfsgen-MLANG/,$(filestocopy)): $$(INPUT)
mkdir -p $$(dirname $@)
if [ -f $< ]; then cp $< $@; else cp -r $< $$(dirname $@); fi
genhtml-MLANG-sysv: $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=sysv BASEDIR=../$(HTMLDIRSYSV_MLANG) book
genhtml-MLANG-sysd: $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=systemd BASEDIR=../$(HTMLDIRSYSD_MLANG) book
genpdf-MLANG-sysv: $(PDFSYSV_MLANG)
$(PDFSYSV_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=sysv BASEDIR=.. pdf
mv LFS-BOOK.pdf $@
genpdf-MLANG-sysd: $(PDFSYSD_MLANG)
$(PDFSYSD_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=systemd BASEDIR=.. pdf
mv LFS-SYSD-BOOK.pdf $@
gentar-MLANG-sysv: $(HTMLTARSYSV_MLANG)
$(HTMLTARSYSV_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG) genhtml-MLANG-sysv
rm -f $@
tar cjf $@ $(HTMLDIRSYSV_MLANG)
gentar-MLANG-sysd: $(HTMLTARSYSD_MLANG)
$(HTMLTARSYSD_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG) genhtml-MLANG-sysd
rm -f $@
tar cjf $@ $(HTMLDIRSYSD_MLANG)
genepub-MLANG-sysv: $(EPUBSYSV_MLANG)
$(EPUBSYSV_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=sysv EPUB_OUTPUT=$@ epub
genepub-MLANG-sysd: $(EPUBSYSD_MLANG)
$(EPUBSYSD_MLANG): $(XML_MLANG) $(COPY_MLANG) $(IMAGES_MLANG) $(STYLESHEETS_MLANG)
LANG=$(LANG_MLANG) make -C lfsgen-MLANG -j1 REV=systemd EPUB_OUTPUT=$@ epub
upload-MLANG-sysv: $(SSH_AGENT)
cd $(HTMLDIRSYSV_MLANG) ;\
chmod g+w -R . ;\
rsync --progress --recursive * $(USER)@www.linuxfromscratch.org:/srv/www/www.MLANG.linuxfromscratch.org/view/lfs-svn/
upload-MLANG-sysd: $(SSH_AGENT)
cd $(HTMLDIRSYSD_MLANG) ;\
chmod g+w -R . ;\
rsync --progress --recursive * $(USER)@www.linuxfromscratch.org:/srv/www/www.MLANG.linuxfromscratch.org/view/lfs-systemd-svn/