source: Makefile@ 1f76d4d

Last change on this file since 1f76d4d was 364f16f, checked in by Krejzi <krejzi@…>, 10 years ago

Remove network scripts.

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

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