source: Makefile@ 0e6d3c0

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 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 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 0e6d3c0 was 0e6d3c0, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Refactored the Makefile.

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

  • Property mode set to 100644
File size: 2.9 KB
Line 
1BASEDIR=~/lfs-book
2DUMPDIR=~/lfs-commands
3CHUNK_QUIET=1
4ROOT_ID=""
5PDF_OUTPUT=LFS-BOOK.pdf
6NOCHUNKS_OUTPUT=LFS-BOOK.html
7
8lfs: validxml profile-html
9 @echo "Generating chunked XHTML files..."
10 @xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
11 -stringparam rootid $(ROOT_ID) -stringparam base.dir $(BASEDIR)/ \
12 stylesheets/lfs-chunked.xsl /tmp/lfs-html.xml
13
14 @echo "Copying CSS code and images..."
15 @if [ ! -e $(BASEDIR)/stylesheets ]; then \
16 mkdir -p $(BASEDIR)/stylesheets; \
17 fi;
18 @cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
19 @if [ ! -e $(BASEDIR)/images ]; then \
20 mkdir -p $(BASEDIR)/images; \
21 fi;
22 @cp images/*.png $(BASEDIR)/images
23 @cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
24 @cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
25
26 @echo "Running Tidy..."
27 @for filename in `find $(BASEDIR) -name "*.html"`; do \
28 tidy -config tidy.conf $$filename; \
29 true; \
30 sh obfuscate.sh $$filename; \
31 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
32 done;
33
34 @$(MAKE) wget-list
35
36pdf: validxml
37 @echo "Generating profiled XML for PDF..."
38 @xsltproc --nonet --stringparam profile.condition pdf \
39 --output /tmp/lfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
40 /tmp/lfs-full.xml
41
42 @echo "Generating FO file..."
43 @xsltproc --nonet -stringparam rootid $(ROOT_ID) \
44 --output /tmp//lfs-pdf.fo stylesheets/lfs-pdf.xsl /tmp/lfs-pdf.xml
45 @sed -i -e 's/span="inherit"/span="all"/' /tmp/lfs-pdf.fo
46
47 @echo "Generating PDF file..."
48 @fop /tmp/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
49
50nochunks: validxml profile-html
51 @echo "Generating non chunked XHTML file..."
52 @xsltproc --nonet -stringparam profile.condition html \
53 -stringparam rootid $(ROOT_ID) --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
54 stylesheets/lfs-nochunks.xsl /tmp/lfs-html.xml
55
56 @echo "Running Tidy..."
57 @tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
58 @sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
59 @sed -i -e "s@text/html@application/xhtml+xml@g" \
60 $(BASEDIR)/$(NOCHUNKS_OUTPUT)
61
62validxml:
63 @echo "Validating the book..."
64 @xmllint --nonet --noent --xinclude --postvalid \
65 -o /tmp/lfs-full.xml index.xml
66
67profile-html: validxml
68 @echo "Generating profiled XML for XHTML..."
69 @xsltproc --nonet --stringparam profile.condition html \
70 --output /tmp/lfs-html.xml stylesheets/lfs-xsl/profile.xsl \
71 /tmp/lfs-full.xml
72
73wget-list:
74 @echo "Generating wget list..."
75 @mkdir -p $(BASEDIR)
76 @xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
77 stylesheets/wget-list.xsl chapter03/chapter03.xml
78
79dump-commands:
80 @echo "Dumping book commands..."
81 @xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
82 stylesheets/dump-commands.xsl index.xml
83
84validate:
85 @echo "Validating the book..."
86 @xmllint --noout --nonet --xinclude --postvalid index.xml
87
88all: lfs nochunks pdf dump-commands
89
90.PHONY : all dump-commands lfs nochunks pdf profile-html validate validxml wget-list
Note: See TracBrowser for help on using the repository browser.