Changeset efe19ba
- Timestamp:
- 06/01/2016 07:02:11 PM (8 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- f8f7442
- Parents:
- 71a97607
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r71a97607 refe19ba 6 6 7 7 # Adjust these to suit your installation 8 BASEDIR ?= $(HOME)/public_html/blfs-book-xsl 9 DUMPDIR ?= $(HOME)/blfs-commands 10 RENDERTMP ?= tmp 11 CHUNK_QUIET = 1 12 ROOT_ID = 13 #PDF_OUTPUT = BLFS-BOOK.pdf 14 NOCHUNKS_OUTPUT = BLFS-BOOK.html 15 SHELL = /bin/bash 8 RENDERTMP ?= $(HOME)/tmp 9 CHUNK_QUIET = 1 10 ROOT_ID = 11 SHELL = /bin/bash 16 12 17 13 ALLXML := $(filter-out $(RENDERTMP)/%, \ … … 26 22 endif 27 23 24 ifndef REV 25 REV = sysv 26 endif 27 28 ifneq ($(REV), sysv) 29 ifneq ($(REV), systemd) 30 $(error REV must be 'sysv' (default) or 'systemd'.) 31 endif 32 endif 33 34 ifeq ($(REV), sysv) 35 BASEDIR ?= $(HOME)/public_html/blfs-book 36 NOCHUNKS_OUTPUT ?= blfs-book.html 37 DUMPDIR ?= ~/blfs-commands 38 else 39 BASEDIR ?= $(HOME)/public_html/blfs-systemd 40 NOCHUNKS_OUTPUT ?= blfs-sysd-book.html 41 DUMPDIR ?= ~/blfs-sysd-commands 42 endif 43 44 28 45 blfs: html wget-list 29 #all: blfs nochunks pdf 46 30 47 all: blfs nochunks 31 48 world: all blfs-patch-list dump-commands test-links … … 34 51 $(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml 35 52 @echo "Generating chunked XHTML files..." 36 $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \ 37 -stringparam rootid "$(ROOT_ID)" -stringparam base.dir $(BASEDIR)/ \ 38 stylesheets/blfs-chunked.xsl $(RENDERTMP)/blfs-html.xml 53 $(Q)xsltproc --nonet \ 54 --stringparam chunk.quietly $(CHUNK_QUIET) \ 55 --stringparam rootid "$(ROOT_ID)" \ 56 --stringparam base.dir $(BASEDIR)/ \ 57 stylesheets/blfs-chunked.xsl \ 58 $(RENDERTMP)/blfs-html.xml 39 59 40 60 @echo "Copying CSS code and images..." 41 61 $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \ 42 mkdir -p $(BASEDIR)/stylesheets; \ 43 fi; 62 mkdir -p $(BASEDIR)/stylesheets; \ 63 fi; 64 44 65 $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets 66 45 67 $(Q)if [ ! -e $(BASEDIR)/images ]; then \ 46 mkdir -p $(BASEDIR)/images;\47 68 mkdir -p $(BASEDIR)/images; \ 69 fi; 48 70 $(Q)cp images/*.png $(BASEDIR)/images 49 $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html 50 $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html 71 72 $(Q)cd $(BASEDIR)/; sed -e "s@../stylesheets@stylesheets@g" \ 73 -e "s@../images@images@g" \ 74 -i *.html 51 75 52 76 @echo "Running Tidy and obfuscate.sh on chunked XHTML..." 53 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \ 54 tidy -config tidy.conf $$filename; \ 55 true; \ 56 bash obfuscate.sh $$filename; \ 57 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \ 58 done; 59 60 #pdf: $(BASEDIR)/$(PDF_OUTPUT) 61 #$(RENDERTMP)/blfs-pdf.xml: $(RENDERTMP)/blfs-full.xml 62 # @echo "Generating profiled XML for PDF..." 63 # $(Q)xsltproc --nonet --stringparam profile.condition pdf \ 64 --output $(RENDERTMP)/blfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \ 65 $(RENDERTMP)/blfs-full.xml 66 67 #$(RENDERTMP)/blfs-pdf.fo: $(RENDERTMP)/blfs-pdf.xml 68 # @echo "Generating FO file..." 69 # $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 70 --output $(RENDERTMP)/blfs-pdf.fo stylesheets/blfs-pdf.xsl \ 71 $(RENDERTMP)/blfs-pdf.xml 72 # $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/blfs-pdf.fo 73 74 #$(BASEDIR)/$(PDF_OUTPUT): $(RENDERTMP)/blfs-pdf.fo 75 # @echo "Generating PDF file..." 76 # $(Q)if [ ! -e $(BASEDIR) ]; then \ 77 mkdir -p $(BASEDIR); \ 78 fi; 79 # $(Q)fop $(RENDERTMP)/blfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) 77 $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \ 78 tidy -config tidy.conf $$filename; \ 79 true; \ 80 bash obfuscate.sh $$filename; \ 81 sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \ 82 done; 80 83 81 84 nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT) 82 85 $(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml 83 86 @echo "Generating non-chunked XHTML file..." 84 $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \ 85 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ 86 stylesheets/blfs-nochunks.xsl $(RENDERTMP)/blfs-html.xml 87 $(Q)xsltproc --nonet \ 88 --stringparam rootid "$(ROOT_ID)" \ 89 --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ 90 stylesheets/blfs-nochunks.xsl \ 91 $(RENDERTMP)/blfs-html.xml 87 92 88 93 @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..." 89 94 $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true 90 95 $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) 91 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" \ 92 $(BASEDIR)/$(NOCHUNKS_OUTPUT) 96 $(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT) 93 97 94 98 tmpdir: $(RENDERTMP) … … 100 104 @echo "Cleaning $(RENDERTMP)" 101 105 $(Q)rm -f $(RENDERTMP)/blfs-{full,html}.xml 102 # $(Q)rm -f $(RENDERTMP)/blfs-{full,html,pdf}.xml103 # $(Q)rm -f $(RENDERTMP)/blfs-pdf.fo104 106 $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches} 105 $(Q)rmdir $(RENDERTMP) 2>/dev/null || : 106 107 validxml: $(RENDERTMP)/blfs-full.xml 107 108 validate: $(RENDERTMP)/blfs-full.xml 108 109 $(RENDERTMP)/blfs-full.xml: general.ent $(ALLXML) $(ALLXSL) 110 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 111 112 @echo "Adjusting for revision $(REV)..." 113 $(Q)xsltproc --nonet \ 114 --xinclude \ 115 --output $(RENDERTMP)/blfs-html2.xml \ 116 --stringparam profile.revision $(REV) \ 117 stylesheets/lfs-xsl/profile.xsl \ 118 index.xml 119 109 120 @echo "Validating the book..." 110 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) 111 $(Q)xmllint --nonet --noent --xinclude --postvalid \ 112 -o $(RENDERTMP)/blfs-full.xml index.xml 121 $(Q)xmllint --nonet \ 122 --noent \ 123 --postvalid \ 124 --output $(RENDERTMP)/blfs-full.xml \ 125 $(RENDERTMP)/blfs-html2.xml 113 126 114 127 profile-html: $(RENDERTMP)/blfs-html.xml 115 128 $(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml 116 129 @echo "Generating profiled XML for XHTML..." 117 $(Q)xsltproc --nonet --stringparam profile.condition html \ 118 --output $(RENDERTMP)/blfs-html.xml stylesheets/lfs-xsl/profile.xsl \ 119 $(RENDERTMP)/blfs-full.xml 130 $(Q)xsltproc --nonet \ 131 --stringparam profile.condition html \ 132 --output $(RENDERTMP)/blfs-html.xml \ 133 stylesheets/lfs-xsl/profile.xsl \ 134 $(RENDERTMP)/blfs-full.xml 120 135 121 136 blfs-patch-list: blfs-patches.sh … … 126 141 blfs-patches.sh: $(RENDERTMP)/blfs-full.xml 127 142 @echo "Generating blfs patch script..." 128 $(Q)xsltproc --nonet --output blfs-patches.sh \ 129 stylesheets/patcheslist.xsl $(RENDERTMP)/blfs-full.xml 143 $(Q)xsltproc --nonet \ 144 --output blfs-patches.sh \ 145 stylesheets/patcheslist.xsl \ 146 $(RENDERTMP)/blfs-full.xml 130 147 131 148 wget-list: $(BASEDIR)/wget-list 132 149 $(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml 133 @echo "Generating wget list ..."150 @echo "Generating wget list for $(REV) at $(BASEDIR)/wget-list ..." 134 151 $(Q)mkdir -p $(BASEDIR) 135 $(Q)xsltproc --nonet --output $(BASEDIR)/wget-list \ 136 stylesheets/wget-list.xsl $(RENDERTMP)/blfs-full.xml 152 $(Q)xsltproc --nonet \ 153 --output $(BASEDIR)/wget-list \ 154 stylesheets/wget-list.xsl \ 155 $(RENDERTMP)/blfs-full.xml 137 156 138 157 test-links: $(BASEDIR)/test-links … … 140 159 @echo "Generating test-links file..." 141 160 $(Q)mkdir -p $(BASEDIR) 142 $(Q)xsltproc --nonet --stringparam list_mode full \ 143 --output $(BASEDIR)/test-links stylesheets/wget-list.xsl \ 144 $(RENDERTMP)/blfs-full.xml 161 $(Q)xsltproc --nonet \ 162 --stringparam list_mode full \ 163 --output $(BASEDIR)/test-links \ 164 stylesheets/wget-list.xsl \ 165 $(RENDERTMP)/blfs-full.xml 145 166 146 167 @echo "Checking URLs, first pass..." 147 168 $(Q)rm -f $(BASEDIR)/{good,bad,true_bad}_urls 148 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \ 149 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \ 150 if test $$? -ne 0 ; then echo $$URL >> $(BASEDIR)/bad_urls ; \ 151 else echo $$URL >> $(BASEDIR)/good_urls 2>&1; \ 152 fi; \ 153 done 169 $(Q)for URL in `cat $(BASEDIR)/test-links`; do \ 170 wget --spider --tries=2 --timeout=60 $$URL >>/dev/null 2>&1; \ 171 if test $$? -ne 0 ; then \ 172 echo $$URL >> $(BASEDIR)/bad_urls ; \ 173 else \ 174 echo $$URL >> $(BASEDIR)/good_urls 2>&1; \ 175 fi; \ 176 done 154 177 155 178 @echo "Checking URLs, second pass..." 156 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \ 157 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \ 158 if test $$? -ne 0 ; then echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \ 159 else echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \ 160 fi; \ 161 done 179 $(Q)for URL2 in `cat $(BASEDIR)/bad_urls`; do \ 180 wget --spider --tries=2 --timeout=60 $$URL2 >>/dev/null 2>&1; \ 181 if test $$? -ne 0 ; then \ 182 echo $$URL2 >> $(BASEDIR)/true_bad_urls ; \ 183 else \ 184 echo $$URL2 >> $(BASEDIR)/good_urls 2>&1; \ 185 fi; \ 186 done 162 187 163 188 bootscripts: 164 189 @VERSION=`grep "bootscripts-version " general.ent | cut -d\" -f2`; \ 165 BOOTSCRIPTS="blfs-bootscripts-$$VERSION"; \166 if [ ! -e $$BOOTSCRIPTS.tar.xz ]; then \167 rm -rf $(RENDERTMP)/$$BOOTSCRIPTS; \168 mkdir $(RENDERTMP)/$$BOOTSCRIPTS; \169 cp -a ../bootscripts/* $(RENDERTMP)/$$BOOTSCRIPTS; \170 rm -rf ../bootscripts/archive; \171 tar -cJhf $$BOOTSCRIPTS.tar.xz -C $(RENDERTMP) $$BOOTSCRIPTS; \190 BOOTSCRIPTS="blfs-bootscripts-$$VERSION"; \ 191 if [ ! -e $$BOOTSCRIPTS.tar.xz ]; then \ 192 rm -rf $(RENDERTMP)/$$BOOTSCRIPTS; \ 193 mkdir $(RENDERTMP)/$$BOOTSCRIPTS; \ 194 cp -a ../bootscripts/* $(RENDERTMP)/$$BOOTSCRIPTS; \ 195 rm -rf ../bootscripts/archive; \ 196 tar -cJhf $$BOOTSCRIPTS.tar.xz -C $(RENDERTMP) $$BOOTSCRIPTS; \ 172 197 fi 173 198 … … 175 200 $(DUMPDIR): $(RENDERTMP)/blfs-full.xml 176 201 @echo "Dumping book commands..." 177 $(Q)xsltproc --output $(DUMPDIR)/ \ 178 stylesheets/dump-commands.xsl $(RENDERTMP)/blfs-full.xml 202 $(Q)xsltproc --output $(DUMPDIR)/ \ 203 stylesheets/dump-commands.xsl \ 204 $(RENDERTMP)/blfs-full.xml 179 205 $(Q)touch $(DUMPDIR) 180 206 181 validate: 182 @echo "Validating the book..." 183 $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml 184 185 .PHONY: blfs all world html nochunks tmpdir clean validxml \ 186 profile-html wget-list test-links dump-commands validate \ 187 bootscripts 188 189 #.PHONY: blfs all world html pdf nochunks tmpdir clean validxml \ 190 profile-html wget-list test-links dump-commands validate 207 .PHONY: blfs all world html nochunks tmpdir clean \ 208 validate profile-html blfs-patch-list wget-list test-links \ 209 dump-commands bootscripts 210 211
Note:
See TracChangeset
for help on using the changeset viewer.