source: Makefile@ 9218b05

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 7.9 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 9218b05 was 1c27a53, checked in by Bruce Dubbs <bdubbs@…>, 9 years ago

Update to tzdata-2015f.
Add a workaround to ncurses in Chapter 5 for hosts that have mawk installed.
Document some minor test failures.

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

  • Property mode set to 100644
File size: 4.4 KB
Line 
1BASEDIR = ~/lfs-book
2DUMPDIR = ~/lfs-commands
3RENDERTMP = $(HOME)/tmp
4CHUNK_QUIET = 1
5ROOT_ID =
6PDF_OUTPUT = LFS-BOOK.pdf
7NOCHUNKS_OUTPUT = LFS-BOOK.html
8SHELL = /bin/bash
9
10ifdef V
11 Q =
12else
13 Q = @
14endif
15
16lfs: validate profile-html
17 @echo "Generating chunked XHTML files..."
18 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
19 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \
20 stylesheets/lfs-chunked.xsl $(RENDERTMP)/lfs-html.xml
21
22 @echo "Copying CSS code and images..."
23 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
24 mkdir -p $(BASEDIR)/stylesheets; \
25 fi;
26 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
27 $(Q)pushd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html; popd
28
29 $(Q)if [ ! -e $(BASEDIR)/images ]; then \
30 mkdir -p $(BASEDIR)/images; \
31 fi;
32 $(Q)cp images/*.png $(BASEDIR)/images
33# $(Q)pushd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html; popd
34
35 @echo "Running Tidy and obfuscate.sh..."
36 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
37 tidy -config tidy.conf $$filename; \
38 true; \
39 /bin/bash obfuscate.sh $$filename; \
40 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
41 done;
42
43 $(Q)$(MAKE) $(BASEDIR)/wget-list $(BASEDIR)/md5sums
44
45pdf: validate
46 @echo "Generating profiled XML for PDF..."
47 $(Q)xsltproc --nonet --stringparam profile.condition pdf \
48 --output $(RENDERTMP)/lfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
49 $(RENDERTMP)/lfs-full.xml
50
51 @echo "Generating FO file..."
52 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
53 --output $(RENDERTMP)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
54 $(RENDERTMP)/lfs-pdf.xml
55 $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/lfs-pdf.fo
56 $(Q)bash pdf-fixups.sh $(RENDERTMP)/lfs-pdf.fo
57
58 @echo "Generating PDF file..."
59 $(Q)if [ ! -e $(BASEDIR) ]; then \
60 mkdir -p $(BASEDIR); \
61 fi;
62 $(Q)fop -q $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) 2>fop.log
63 @echo "$(BASEDIR)/$(PDF_OUTPUT) created"
64 @echo "fop.log created"
65
66nochunks: validate profile-html
67 @echo "Generating non chunked XHTML file..."
68 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
69 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
70 stylesheets/lfs-nochunks.xsl $(RENDERTMP)/lfs-html.xml
71
72 @echo "Running Tidy..."
73 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
74 @echo "Running obfuscate.sh..."
75 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
76 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
77 $(Q)sed -i -e "s@../wget-list@wget-list@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
78 $(Q)sed -i -e "s@../md5sums@md5sums@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
79 $(Q)$(MAKE) $(BASEDIR)/wget-list $(BASEDIR)/md5sums
80
81tmpdir:
82 @echo "Creating and cleaning $(RENDERTMP)"
83 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
84 $(Q)rm -f $(RENDERTMP)/lfs-{full,html,pdf}.xml
85 $(Q)rm -f $(RENDERTMP)/lfs-pdf.fo
86
87validate: tmpdir
88 @echo "Processing bootscripts..."
89 $(Q)bash process-scripts.sh
90 @echo "Validating the book..."
91 $(Q)xmllint --nonet --noent --xinclude --postvalid \
92 -o $(RENDERTMP)/lfs-full.xml index.xml
93 $(Q)rm -f appendices/*.script
94 $(Q)./aux-file-data.sh $(RENDERTMP)/lfs-full.xml
95 @echo "Validation complete."
96
97profile-html: validate
98 @echo "Generating profiled XML for XHTML..."
99 $(Q)xsltproc --nonet --stringparam profile.condition html \
100 --output $(RENDERTMP)/lfs-html.xml stylesheets/lfs-xsl/profile.xsl \
101 $(RENDERTMP)/lfs-full.xml
102
103wget-list: $(BASEDIR)/wget-list
104$(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml packages.ent patches.ent
105 @echo "Generating wget list..."
106 $(Q)mkdir -p $(BASEDIR)
107 $(Q)xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
108 stylesheets/wget-list.xsl chapter03/chapter03.xml
109
110md5sums: $(BASEDIR)/md5sums
111$(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml packages.ent patches.ent
112 @echo "Generating md5sum file..."
113 $(Q)mkdir -p $(BASEDIR)
114 $(Q)xsltproc --xinclude --nonet --output $(BASEDIR)/md5sums \
115 stylesheets/md5sum.xsl chapter03/chapter03.xml
116 $(Q)sed -i -e \
117 "s/BOOTSCRIPTS-MD5SUM/$(shell md5sum lfs-bootscripts*.tar.bz2 | cut -d' ' -f1)/" \
118 $(BASEDIR)/md5sums
119
120dump-commands: validate
121 @echo "Dumping book commands..."
122 $(Q)xsltproc --output $(DUMPDIR)/ \
123 stylesheets/dump-commands.xsl $(RENDERTMP)/lfs-full.xml
124
125
126all: lfs nochunks pdf dump-commands
127
128.PHONY : all dump-commands lfs nochunks pdf profile-html tmpdir validate
129
Note: See TracBrowser for help on using the repository browser.