source: Makefile@ 6702623

ml-11.0 multilib
Last change on this file since 6702623 was b3f1ebb3, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

First apply of multilib-patch of April 1st, 2019

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

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