source: Makefile@ 23a0f82

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 23a0f82 was 23a0f82, checked in by Bruce Dubbs <bdubbs@…>, 8 years ago

Update to tzdata-2016f.
Add discussion of Grub Bios Partition.
Fix Makefile for proper total package size calculation.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11093 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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