[d63b7ee] | 1 | TOP := $(shell pwd)
|
---|
[879785b] | 2 | RENDERDIR := $(TOP)/../render
|
---|
[2b77c9d4] | 3 |
|
---|
[879785b] | 4 | VALIDATEDIR := $(RENDERDIR)/validate
|
---|
[4fe47e3] | 5 | DBXMLDIR := $(RENDERDIR)/docbook
|
---|
[879785b] | 6 | PROFILEDIR := $(RENDERDIR)/profile
|
---|
[2b77c9d4] | 7 |
|
---|
[879785b] | 8 | HTMLDIR := $(RENDERDIR)/html
|
---|
| 9 | NOCHUNKDIR := $(RENDERDIR)/nochunk
|
---|
| 10 |
|
---|
| 11 | FODIR := $(RENDERDIR)/fo
|
---|
| 12 | PDFDIR := $(RENDERDIR)/pdf
|
---|
| 13 |
|
---|
| 14 | TROUBLEDIR := $(RENDERDIR)/trouble
|
---|
| 15 | DUMPDIR := $(RENDERDIR)/commands
|
---|
| 16 | DLLISTDIR := $(RENDERDIR)/download-list
|
---|
[157ab39] | 17 |
|
---|
[879785b] | 18 | CHUNK_QUIET := 1
|
---|
| 19 | ROOT_ID :=
|
---|
[157ab39] | 20 |
|
---|
[b47a4a1] | 21 | ARCHS := x86 x86_64 x86_64-64 \
|
---|
| 22 | sparc sparc64 sparc64-64 \
|
---|
| 23 | mips mips64 mips64-64 \
|
---|
| 24 | ppc ppc64 \
|
---|
| 25 | alpha
|
---|
[157ab39] | 26 |
|
---|
[4fe47e3] | 27 | x86_ML := 32
|
---|
| 28 | x86_64_ML := 32,64
|
---|
| 29 | x86_64-64_ML := 64
|
---|
| 30 | sparc_ML := 32
|
---|
| 31 | sparc64_ML := 32,64
|
---|
| 32 | sparc64-64_ML := 64
|
---|
| 33 | mips_ML := 32
|
---|
| 34 | mips64_ML := 32,n32,64
|
---|
| 35 | mips64-64_ML := 64
|
---|
| 36 | ppc_ML := 32
|
---|
| 37 | ppc64_ML := 32,64
|
---|
| 38 | alpha_ML := 64
|
---|
| 39 |
|
---|
[fd5c672] | 40 | ifdef V
|
---|
| 41 | Q =
|
---|
| 42 | else
|
---|
| 43 | Q = @
|
---|
| 44 | endif
|
---|
| 45 |
|
---|
[879785b] | 46 | .PHONY: clfs lfs
|
---|
| 47 | clfs lfs: html
|
---|
[157ab39] | 48 |
|
---|
[b47a4a1] | 49 | .PHONY: tidy tidy-f tidy-d
|
---|
[157ab39] | 50 | ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
|
---|
| 51 | tidy:
|
---|
[879785b] | 52 | @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)
|
---|
[c695188] | 53 |
|
---|
| 54 | tidy-f:
|
---|
| 55 | @echo "Running tidy on F:$(shell basename $(TIDY_FILE))"
|
---|
| 56 | @$(TOP)/tidy.sh "$(TIDY_FILE)"
|
---|
| 57 |
|
---|
| 58 | tidy-d:
|
---|
| 59 | @echo "Running tidy on D:$(shell basename $(TIDY_DIR))"
|
---|
| 60 | @$(TOP)/tidy.sh "$(TIDY_DIR)"
|
---|
[157ab39] | 61 | else
|
---|
[c695188] | 62 | tidy tidy-f tidy-d:
|
---|
[fd5c672] | 63 | @echo "Tidy is not installed on this system"
|
---|
[157ab39] | 64 | endif
|
---|
| 65 |
|
---|
[b47a4a1] | 66 | .PHONY: titlepage
|
---|
[157ab39] | 67 | titlepage:
|
---|
[c695188] | 68 | @echo "Rendering the top-level index..."
|
---|
[879785b] | 69 | $(Q)xsltproc --nonet --output $(HTMLDIR)/index.html \
|
---|
[d63b7ee] | 70 | $(TOP)/stylesheets/top-index.xsl \
|
---|
| 71 | $(TOP)/index.xml
|
---|
[879785b] | 72 | @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(HTMLDIR)/index.html
|
---|
[b47a4a1] | 73 |
|
---|
[879785b] | 74 | ARCHS_VD_XML := $(ARCHS:%=%-validate_dump-xml)
|
---|
[b47a4a1] | 75 | .PHONY: $(ARCHS_VD_XML)
|
---|
| 76 | $(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%)
|
---|
[879785b] | 77 | $(ARCHS_VD_XML):
|
---|
[eef46e9] | 78 | @echo "Validating $(arch) against the CLFS Schema..."
|
---|
[879785b] | 79 | $(Q)mkdir -p $(VALIDATEDIR)
|
---|
[da28cc3] | 80 | $(Q)xmllint --nonet --noent --xinclude \
|
---|
[eef46e9] | 81 | --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
|
---|
[879785b] | 82 | -o $(VALIDATEDIR)/$(arch)-full.xml \
|
---|
[271d1f96] | 83 | $(TOP)/$(arch)-index.xml \
|
---|
[eef46e9] | 84 | 2>&1 | grep -v " validates$$"; \
|
---|
| 85 | if test $${?} -ne 0; then true; else false; fi
|
---|
[ff39de2] | 86 |
|
---|
[4fe47e3] | 87 | ARCHS_DB_XML := $(ARCHS:%=%-db-xml)
|
---|
| 88 | .PHONY: $(ARCHS_DB_XML)
|
---|
| 89 | $(ARCHS_DB_XML): override arch = $(@:%-db-xml=%)
|
---|
| 90 | $(ARCHS_DB_XML):
|
---|
| 91 | @$(MAKE) --no-print-directory $(arch)-validate_dump-xml
|
---|
| 92 | @echo "Generating DocBook XML for $(arch)..."
|
---|
| 93 | $(Q)mkdir -p $(DBXMLDIR)
|
---|
| 94 | $(Q)xsltproc --nonet \
|
---|
| 95 | --stringparam clfs.arch "$(arch)" \
|
---|
| 96 | --stringparam clfs.multilib "$($(arch)_ML)" \
|
---|
| 97 | --output $(DBXMLDIR)/$(arch)-db.xml \
|
---|
[271d1f96] | 98 | $(TOP)/stylesheets/clfs-profile.xsl \
|
---|
[4fe47e3] | 99 | $(VALIDATEDIR)/$(arch)-full.xml
|
---|
| 100 |
|
---|
[879785b] | 101 | ARCHS_P_XML := $(ARCHS:%=%-profiled-xml)
|
---|
[b47a4a1] | 102 | .PHONY: $(ARCHS_P_XML)
|
---|
| 103 | $(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%)
|
---|
[879785b] | 104 | $(ARCHS_P_XML):
|
---|
[4fe47e3] | 105 | @$(MAKE) --no-print-directory $(arch)-db-xml
|
---|
[eef46e9] | 106 | @echo "Profiling $(arch) for rendering..."
|
---|
[879785b] | 107 | $(Q)mkdir -p $(PROFILEDIR)
|
---|
[4fe47e3] | 108 | $(Q)xsltproc --nonet \
|
---|
| 109 | --stringparam profile.condition html \
|
---|
[879785b] | 110 | --output $(PROFILEDIR)/$(arch)-html.xml \
|
---|
[d63b7ee] | 111 | $(TOP)/stylesheets/lfs-xsl/profile.xsl \
|
---|
[4fe47e3] | 112 | $(DBXMLDIR)/$(arch)-db.xml
|
---|
[bc7834d] | 113 |
|
---|
[eef46e9] | 114 | ARCHS_VDB_XML := $(ARCHS:%=%-validate_db-xml)
|
---|
| 115 | .PHONY: $(ARCHS_VDB_XML)
|
---|
| 116 | $(ARCHS_VDB_XML): override arch = $(@:%-validate_db-xml=%)
|
---|
| 117 | $(ARCHS_VDB_XML):
|
---|
| 118 | @echo "Validating $(arch) against the DocBook Schema..."
|
---|
| 119 | $(Q)xmllint --noout --nonet \
|
---|
| 120 | --relaxng $(TOP)/schema/docbook/4.5/rng/docbook.rng \
|
---|
[4fe47e3] | 121 | $(PROFILEDIR)/$(arch)-html.xml \
|
---|
[eef46e9] | 122 | 2>&1 | grep -v " validates$$"; \
|
---|
| 123 | if test $${?} -ne 0; then true; else false; fi
|
---|
| 124 |
|
---|
[879785b] | 125 | ARCHS_HTML := $(ARCHS:%=%-html)
|
---|
| 126 | .PHONY: html render $(ARCHS_HTML)
|
---|
| 127 | html render: $(ARCHS_HTML) titlepage
|
---|
[b47a4a1] | 128 | $(ARCHS_HTML): override arch = $(@:%-html=%)
|
---|
[879785b] | 129 | $(ARCHS_HTML):
|
---|
[b47a4a1] | 130 | @$(MAKE) --no-print-directory $(arch)-profiled-xml
|
---|
[eef46e9] | 131 | @$(MAKE) --no-print-directory $(arch)-validate_db-xml
|
---|
[fd5c672] | 132 |
|
---|
[b47a4a1] | 133 | @echo "Rendering chunked XHTML of $(arch)..."
|
---|
[879785b] | 134 | $(Q)mkdir -p $(HTMLDIR)/$(arch)
|
---|
[fd5c672] | 135 | $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
|
---|
| 136 | -stringparam rootid "$(ROOT_ID)" \
|
---|
[879785b] | 137 | -stringparam base.dir $(HTMLDIR)/$(arch)/ \
|
---|
[d63b7ee] | 138 | $(TOP)/stylesheets/clfs-chunked.xsl \
|
---|
[879785b] | 139 | $(PROFILEDIR)/$(arch)-html.xml
|
---|
[fd5c672] | 140 |
|
---|
[b47a4a1] | 141 | @echo "Copying CSS code and images for $(arch)..."
|
---|
[879785b] | 142 | $(Q)mkdir -p $(HTMLDIR)/$(arch)/stylesheets
|
---|
[d63b7ee] | 143 | $(Q)cp $(TOP)/stylesheets/lfs-xsl/*.css $(HTMLDIR)/$(arch)/stylesheets
|
---|
[879785b] | 144 | $(Q)sed -i -e "s@../stylesheets@stylesheets@g" $(HTMLDIR)/$(arch)/*.html
|
---|
| 145 | $(Q)mkdir -p $(HTMLDIR)/$(arch)/images
|
---|
[d63b7ee] | 146 | $(Q)cp $(TOP)/images/*.png $(HTMLDIR)/$(arch)/images
|
---|
[879785b] | 147 | $(Q)sed -i -e "s@../images@images@g" $(HTMLDIR)/$(arch)/*.html
|
---|
| 148 |
|
---|
| 149 | @$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)/$(arch)
|
---|
| 150 |
|
---|
| 151 | ARCHS_NOCHUNKS := $(ARCHS:%=%-nochunks)
|
---|
| 152 | .PHONY: nochunks $(ARCHS_NOCHUNKS)
|
---|
| 153 | nochunks: $(ARCHS_NOCHUNKS)
|
---|
[b47a4a1] | 154 | $(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
|
---|
[879785b] | 155 | $(ARCHS_NOCHUNKS):
|
---|
[b47a4a1] | 156 | @$(MAKE) --no-print-directory $(arch)-profiled-xml
|
---|
[eef46e9] | 157 | @$(MAKE) --no-print-directory $(arch)-validate_db-xml
|
---|
[fd5c672] | 158 |
|
---|
[b47a4a1] | 159 | @echo "Rendering Single File HTML of $(arch)..."
|
---|
[879785b] | 160 | $(Q)mkdir -p $(NOCHUNKDIR)
|
---|
[fd5c672] | 161 | $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
|
---|
[879785b] | 162 | --output $(NOCHUNKDIR)/CLFS-$(arch).html \
|
---|
[d63b7ee] | 163 | $(TOP)/stylesheets/clfs-nochunks.xsl \
|
---|
[879785b] | 164 | $(PROFILEDIR)/$(arch)-html.xml
|
---|
[fd5c672] | 165 |
|
---|
[879785b] | 166 | @$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(NOCHUNKDIR)/CLFS-$(arch).html
|
---|
[157ab39] | 167 |
|
---|
[879785b] | 168 | ARCHS_FO := $(ARCHS:%=%-fo)
|
---|
| 169 | .PHONY: fo $(ARCHS_FO)
|
---|
| 170 | fo: $(ARCHS_FO)
|
---|
| 171 | $(ARCHS_FO): override arch = $(@:%-fo=%)
|
---|
| 172 | $(ARCHS_FO):
|
---|
[b47a4a1] | 173 | @$(MAKE) --no-print-directory $(arch)-profiled-xml
|
---|
[eef46e9] | 174 | @$(MAKE) --no-print-directory $(arch)-validate_db-xml
|
---|
[fd5c672] | 175 |
|
---|
[b47a4a1] | 176 | @echo "Generating FO file of $(arch)..."
|
---|
[879785b] | 177 | @mkdir -p $(FODIR)
|
---|
[fd5c672] | 178 | $(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
|
---|
[879785b] | 179 | --output $(FODIR)/$(arch).fo \
|
---|
[d63b7ee] | 180 | $(TOP)/stylesheets/clfs-pdf.xsl \
|
---|
[879785b] | 181 | $(PROFILEDIR)/$(arch)-html.xml
|
---|
| 182 | $(Q)sed -i -e 's/span="inherit"/span="all"/' $(FODIR)/$(arch).fo
|
---|
| 183 |
|
---|
| 184 | ARCHS_PDF := $(ARCHS:%=%-pdf)
|
---|
| 185 | .PHONY: pdf $(ARCHS_PDF)
|
---|
| 186 | pdf: $(ARCHS_PDF)
|
---|
| 187 | $(ARCHS_PDF): override arch = $(@:%-pdf=%)
|
---|
| 188 | $(ARCHS_PDF):
|
---|
| 189 | @$(MAKE) --no-print-directory $(arch)-fo
|
---|
[157ab39] | 190 |
|
---|
[b47a4a1] | 191 | @echo "Rendering PDF of $(arch)..."
|
---|
[879785b] | 192 | $(Q)mkdir -p $(PDFDIR)
|
---|
| 193 | $(Q)fop $(FODIR)/$(arch).fo $(PDFDIR)/CLFS-$(arch).pdf
|
---|
[157ab39] | 194 |
|
---|
[879785b] | 195 | ARCHS_VALIDATE := $(ARCHS:%=%-validate)
|
---|
| 196 | .PHONY: validate $(ARCHS_VALIDATE)
|
---|
| 197 | validate: $(ARCHS_VALIDATE)
|
---|
[b47a4a1] | 198 | $(ARCHS_VALIDATE): override arch = $(@:%-validate=%)
|
---|
[157ab39] | 199 | $(ARCHS_VALIDATE):
|
---|
[eef46e9] | 200 | @echo "Validating $(arch) against the CLFS Schema..."
|
---|
[da28cc3] | 201 | $(Q)xmllint --xinclude --noout --nonet \
|
---|
[eef46e9] | 202 | --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
|
---|
[271d1f96] | 203 | $(TOP)/$(arch)-index.xml \
|
---|
[eef46e9] | 204 | 2>&1 | grep -v " validates$$"; \
|
---|
| 205 | if test $${?} -ne 0; then true; else false; fi
|
---|
[879785b] | 206 |
|
---|
| 207 | ARCHS_TROUBLE := $(ARCHS:%=%-trouble)
|
---|
| 208 | .PHONY: trouble $(ARCHS_TROUBLE)
|
---|
| 209 | trouble: $(ARCHS_TROUBLE)
|
---|
| 210 | $(ARCHS_TROUBLE): override arch = $(@:%-trouble=%)
|
---|
| 211 | $(ARCHS_TROUBLE):
|
---|
| 212 | @echo "Troubleshooting $(arch)..."
|
---|
| 213 | @mkdir -p $(TROUBLEDIR)
|
---|
[da28cc3] | 214 | $(Q)xmllint --xinclude --nonet \
|
---|
[eef46e9] | 215 | --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
|
---|
[879785b] | 216 | -o $(TROUBLEDIR)/dump-$(arch) \
|
---|
[271d1f96] | 217 | $(TOP)/$(arch)-index.xml \
|
---|
[eef46e9] | 218 | 2>&1 | grep -v " validates$$"; \
|
---|
| 219 | if test $${?} -ne 0; then true; else false; fi
|
---|
[da28cc3] | 220 | $(Q)xmllint --xinclude --noout --nonet \
|
---|
[eef46e9] | 221 | --relaxng $(TOP)/schema/clfs/0.1/rng/clfs.rng \
|
---|
| 222 | $(TROUBLEDIR)/dump-$(arch) \
|
---|
| 223 | 2>&1 | grep -v " validates$$"; \
|
---|
| 224 | if test $${?} -ne 0; then true; else false; fi
|
---|
[879785b] | 225 | @echo "You can now look at $(TROUBLEDIR)/dump-$(arch) to see the errors"
|
---|
| 226 |
|
---|
| 227 | ARCHS_DUMP := $(ARCHS:%=%-dump)
|
---|
| 228 | .PHONY: dump-commands $(ARCHS_DUMP)
|
---|
| 229 | dump-commands: $(ARCHS_DUMP)
|
---|
| 230 | $(ARCHS_DUMP): override arch = $(@:%-dump=%)
|
---|
[157ab39] | 231 | $(ARCHS_DUMP):
|
---|
[b47a4a1] | 232 | @echo "Extracting commands from $(arch)..."
|
---|
| 233 | $(Q)mkdir -p $(DUMPDIR)/$(arch)
|
---|
[879785b] | 234 | $(Q)xsltproc --xinclude --nonet \
|
---|
| 235 | --output $(DUMPDIR)/$(arch)/ \
|
---|
[d63b7ee] | 236 | $(TOP)/stylesheets/dump-commands.xsl \
|
---|
| 237 | $(TOP)/$(arch)-index.xml
|
---|
[157ab39] | 238 |
|
---|
[879785b] | 239 | ARCHS_DLLIST := $(ARCHS:%=%-dllist)
|
---|
| 240 | .PHONY: download-list $(ARCHS_DLLIST)
|
---|
| 241 | download-list: $(ARCHS_DLLIST)
|
---|
[b47a4a1] | 242 | $(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
|
---|
[157ab39] | 243 | $(ARCHS_DLLIST):
|
---|
[b47a4a1] | 244 | @echo "Creating download list for $(arch)..."
|
---|
[fd5c672] | 245 | $(Q)mkdir -p $(DLLISTDIR)
|
---|
[879785b] | 246 | $(Q)xsltproc --xinclude --nonet \
|
---|
| 247 | --output $(DLLISTDIR)/$(arch).list \
|
---|
[d63b7ee] | 248 | $(TOP)/stylesheets/wget.xsl \
|
---|
| 249 | $(TOP)/$(arch)-index.xml
|
---|
[879785b] | 250 |
|
---|
| 251 | FG_GREEN := $(shell echo -e '\e[0;32m')
|
---|
| 252 | FG_BLUE := $(shell echo -e '\e[0;34m')
|
---|
| 253 | FG_DEFAULT := $(shell echo -e '\e[0;0m')
|
---|
[07114c98] | 254 | help:
|
---|
[879785b] | 255 | @echo "Output: $(RENDERDIR)"
|
---|
[2b77c9d4] | 256 | @echo
|
---|
[157ab39] | 257 | @echo "HTML Targets"
|
---|
[879785b] | 258 | @echo " $(FG_GREEN)clfs lfs tidy html render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
|
---|
[157ab39] | 259 | @echo
|
---|
| 260 | @echo "NoChunks Targets"
|
---|
[b47a4a1] | 261 | @echo " $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"
|
---|
[157ab39] | 262 | @echo
|
---|
[879785b] | 263 | @echo "FO Targets"
|
---|
| 264 | @echo " $(FG_GREEN)fo $(FG_BLUE)$(ARCHS_FO)$(FG_DEFAULT)"
|
---|
| 265 | @echo
|
---|
[157ab39] | 266 | @echo "PDF Targets"
|
---|
[b47a4a1] | 267 | @echo " $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"
|
---|
[157ab39] | 268 | @echo
|
---|
| 269 | @echo "Validate Targets"
|
---|
[b47a4a1] | 270 | @echo " $(FG_GREEN)validate $(FG_BLUE)$(ARCHS_VALIDATE)$(FG_DEFAULT)"
|
---|
[157ab39] | 271 | @echo
|
---|
| 272 | @echo "Trouble Targets"
|
---|
[b47a4a1] | 273 | @echo " $(FG_GREEN)trouble $(FG_BLUE)$(ARCHS_TROUBLE)$(FG_DEFAULT)"
|
---|
[157ab39] | 274 | @echo
|
---|
| 275 | @echo "Dump-Commands Targets"
|
---|
[b47a4a1] | 276 | @echo " $(FG_GREEN)dump-commands $(FG_BLUE)$(ARCHS_DUMP)$(FG_DEFAULT)"
|
---|
[157ab39] | 277 | @echo
|
---|
| 278 | @echo "Download-List Targets"
|
---|
[b47a4a1] | 279 | @echo " $(FG_GREEN)download-list $(FG_BLUE)$(ARCHS_DLLIST)$(FG_DEFAULT)"
|
---|