source: Makefile@ 0efb8e1

multilib-10.1
Last change on this file since 0efb8e1 was 0efb8e1, checked in by Thomas Trepl <thomas@…>, 4 years ago

MultiLib: Merge changes from trunk

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11783 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.6 KB
Line 
1#BASEDIR = ~/lfs-book
2#SYSDDIR = ~/lfs-systemd
3#DUMPDIR = ~/lfs-commands
4RENDERTMP = $(HOME)/tmp
5CHUNK_QUIET = 1
6ROOT_ID =
7SHELL = /bin/bash
8
9ifdef V
10 Q =
11else
12 Q = @
13endif
14
15ifndef REV
16 REV = sysv
17endif
18
19ifneq ($(REV), sysv)
20 ifneq ($(REV), systemd)
21 $(error REV must be 'sysv' (default) or 'systemd'.)
22 endif
23endif
24
25ifeq ($(REV), sysv)
26 BASEDIR ?= ~/lfs-book
27 PDF_OUTPUT ?= LFS-BOOK.pdf
28 NOCHUNKS_OUTPUT ?= LFS-BOOK.html
29 DUMPDIR ?= ~/lfs-commands
30else
31 BASEDIR ?= ~/lfs-systemd
32 PDF_OUTPUT ?= LFS-SYSD-BOOK.pdf
33 NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html
34 DUMPDIR ?= ~/lfs-sysd-commands
35endif
36
37ifndef ARCH
38 ARCH = default
39endif
40ifneq ($(ARCH), default)
41 ifneq ($(ARCH), ml_32)
42 ifneq ($(ARCH), ml_x32)
43 ifneq ($(ARCH), ml_all)
44 $(error ARCH must be either 'default' (default if unset), 'ml_32', 'ml_x32' or 'ml_all'.)
45 endif
46 endif
47 endif
48endif
49
50book: validate profile-html
51 @echo "Generating chunked XHTML files at $(BASEDIR)/ ..."
52 $(Q)xsltproc --nonet \
53 --stringparam chunk.quietly $(CHUNK_QUIET) \
54 --stringparam rootid "$(ROOT_ID)" \
55 --stringparam base.dir $(BASEDIR)/ \
56 stylesheets/lfs-chunked.xsl \
57 $(RENDERTMP)/lfs-html.xml
58
59 @echo "Copying CSS code and images..."
60 $(Q)mkdir -p $(BASEDIR)/stylesheets
61 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
62 $(Q)pushd $(BASEDIR)/ > /dev/null; \
63# sed -i -e "s@../stylesheets@stylesheets@g" *.html; \
64 popd > /dev/null
65
66 $(Q)mkdir -p $(BASEDIR)/images
67 $(Q)cp images/*.png $(BASEDIR)/images
68
69 @echo "Running Tidy and obfuscate.sh..."
70 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
71 tidy -config tidy.conf $$filename; \
72 true; \
73 /bin/bash obfuscate.sh $$filename; \
74 sed -e "s@text/html@application/xhtml+xml@g" \
75 -e "s/\xa9/\&copy;/ " \
76 -i $$filename; \
77 done;
78
79 $(Q)$(MAKE) --no-print-directory wget-list md5sums
80
81pdf: validate
82 @echo "Generating profiled XML for PDF..."
83 $(Q)xsltproc --nonet \
84 --stringparam profile.condition pdf \
85 --output $(RENDERTMP)/lfs-pdf.xml \
86 stylesheets/lfs-xsl/profile.xsl \
87 $(RENDERTMP)/lfs-full.xml
88
89 @echo "Generating FO file..."
90 $(Q)xsltproc --nonet \
91 --stringparam rootid "$(ROOT_ID)" \
92 --output $(RENDERTMP)/lfs-pdf.fo \
93 stylesheets/lfs-pdf.xsl \
94 $(RENDERTMP)/lfs-pdf.xml
95
96 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/lfs-pdf.fo
97 $(Q)bash pdf-fixups.sh $(RENDERTMP)/lfs-pdf.fo
98
99 @echo "Generating PDF file..."
100 $(Q)mkdir -p $(RENDERTMP)/images
101 $(Q)cp images/*.png $(RENDERTMP)/images
102
103 $(Q)mkdir -p $(BASEDIR)
104
105 $(Q)fop -q $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) 2>fop.log
106 @echo "$(BASEDIR)/$(PDF_OUTPUT) created"
107 @echo "fop.log created"
108
109nochunks: validate profile-html
110 @echo "Generating non chunked XHTML file..."
111 $(Q)xsltproc --nonet \
112 --stringparam rootid "$(ROOT_ID)" \
113 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
114 stylesheets/lfs-nochunks.xsl \
115 $(RENDERTMP)/lfs-html.xml
116# $(RENDERTMP)/lfs-html2.xml
117
118 @echo "Running Tidy..."
119 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
120
121 @echo "Running obfuscate.sh..."
122 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
123 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
124 $(Q)sed -i -e "s@../wget-list@wget-list@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
125 $(Q)sed -i -e "s@../md5sums@md5sums@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
126 $(Q)sed -i -e "s@\xa9@\&copy;@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
127
128 @echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)"
129
130tmpdir:
131 @echo "Creating and cleaning $(RENDERTMP)"
132 $(Q)mkdir -p $(RENDERTMP)
133 $(Q)rm -f $(RENDERTMP)/lfs*.xml
134 $(Q)rm -f $(RENDERTMP)/*wget*
135 $(Q)rm -f $(RENDERTMP)/*md5sum*
136 $(Q)rm -f $(RENDERTMP)/*pdf.fo
137
138validate: tmpdir
139 @echo "Processing bootscripts..."
140 $(Q)bash process-scripts.sh
141
142 @echo "Adjusting for revision $(REV)..."
143 $(Q)xsltproc --nonet \
144 --xinclude \
145 --output $(RENDERTMP)/lfs-html2.xml \
146 --stringparam profile.revision $(REV) \
147 --stringparam profile.arch $(ARCH) \
148 stylesheets/lfs-xsl/profile.xsl \
149 index.xml
150
151 @echo "Validating the book..."
152 $(Q)xmllint --nonet \
153 --noent \
154 --postvalid \
155 -o $(RENDERTMP)/lfs-full.xml \
156 $(RENDERTMP)/lfs-html2.xml
157
158 $(Q)rm -f appendices/*.script
159 $(Q)./aux-file-data.sh $(RENDERTMP)/lfs-full.xml
160 @echo "Validation complete."
161
162profile-html:
163 @echo "Generating profiled XML for XHTML..."
164 $(Q)xsltproc --nonet \
165 --stringparam profile.condition html \
166 --output $(RENDERTMP)/lfs-html.xml \
167 stylesheets/lfs-xsl/profile.xsl \
168 $(RENDERTMP)/lfs-full.xml
169
170wget-list: $(BASEDIR)/wget-list
171$(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml \
172 packages.ent patches.ent
173 @echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..."
174 $(Q)mkdir -p $(BASEDIR)
175
176# $(Q)xsltproc --nonet --xinclude \
177# --stringparam profile.revision $(REV) \
178# --stringparam profile.arch $(ARCH) \
179# --output $(RENDERTMP)/sysd-wget.xml \
180# stylesheets/lfs-xsl/profile.xsl \
181# chapter03/chapter03.xml
182
183 $(Q)xsltproc --xinclude --nonet \
184 --output $(BASEDIR)/wget-list \
185 stylesheets/wget-list.xsl \
186 chapter03/chapter03.xml
187
188md5sums: $(BASEDIR)/md5sums
189$(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \
190 packages.ent patches.ent
191 @echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..."
192 $(Q)mkdir -p $(BASEDIR)
193
194 $(Q)xsltproc --nonet --xinclude \
195 --stringparam profile.revision $(REV) \
196 --stringparam profile.arch $(ARCH) \
197 --output $(RENDERTMP)/sysv-md5sum.xml \
198 stylesheets/lfs-xsl/profile.xsl \
199 chapter03/chapter03.xml
200
201 $(Q)xsltproc --xinclude --nonet \
202 --output $(BASEDIR)/md5sums \
203 stylesheets/md5sum.xsl \
204 $(RENDERTMP)/sysv-md5sum.xml
205 $(Q)sed -i -e \
206 "s/BOOTSCRIPTS-MD5SUM/$(shell md5sum lfs-bootscripts*.tar.xz | cut -d' ' -f1)/" \
207 $(BASEDIR)/md5sums
208
209#dump-commands: validate
210# @echo "Dumping book commands..."
211# $(Q)xsltproc --nonet \
212# --output $(RENDERTMP)/lfs-html.xml \
213# --stringparam profile.revision $(REV) \
214# --stringparam profile.arch $(ARCH) \
215# stylesheets/lfs-xsl/profile.xsl \
216# $(RENDERTMP)/lfs-full.xml
217
218# $(Q)rm -rf $(DUMPDIR)
219
220# $(Q)xsltproc --output $(DUMPDIR)/ \
221# stylesheets/dump-commands.xsl \
222# $(RENDERTMP)/lfs-html.xml
223# @echo "Dumping book commands complete in $(DUMPDIR)"
224
225all: book nochunks pdf # dump-commands
226
227.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list
228
Note: See TracBrowser for help on using the repository browser.