source: Makefile@ 3781c69

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 arm bdubbs/gcc13 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 3781c69 was 3781c69, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove eol spaces

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