Changeset 35a5259 for Makefile


Ignore:
Timestamp:
05/25/2016 11:16:12 PM (8 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
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, 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
Children:
cbd8bf0f
Parents:
188e34c
Message:

Optimize building merged books

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r188e34c r35a5259  
    1 BASEDIR = ~/lfs-book
    2 SYSDDIR = ~/lfs-systemd
    3 DUMPDIR = ~/lfs-commands
     1#BASEDIR = ~/lfs-book
     2#SYSDDIR = ~/lfs-systemd
     3#DUMPDIR = ~/lfs-commands
    44RENDERTMP = $(HOME)/tmp
    55CHUNK_QUIET = 1
    66ROOT_ID =
    7 PDF_OUTPUT = LFS-BOOK.pdf
    8 PDF_SYSD_OUTPUT = LFS-SYSD-BOOK.pdf
    9 NOCHUNKS_OUTPUT = LFS-BOOK.html
    10 NOCHUNKS_SYSD_FILE = LFS-SYSD-BOOK.html
    117SHELL = /bin/bash
    128
     
    1713endif
    1814
    19 sysv: validate profile-html
    20         $(Q)xsltproc --nonet                   \
    21       --output $(RENDERTMP)/lfs-html2.xml \
    22       --stringparam profile.revision sysv \
    23       stylesheets/lfs-xsl/profile.xsl     \
    24       $(RENDERTMP)/lfs-html.xml
    25 
    26         @echo "Generating chunked XHTML files..."
     15ifndef REV
     16  REV = sysv
     17endif
     18
     19ifneq ($(REV), sysv)
     20  ifneq ($(REV), systemd)
     21    $(error REV must be 'sysv' (default) or 'systemd'.)
     22  endif
     23endif
     24
     25ifeq ($(REV), sysv)
     26  BASEDIR         = ~/lfs-book
     27  PDF_OUTPUT      = LFS-BOOK.pdf
     28  NOCHUNKS_OUTPUT = LFS-BOOK.html
     29  DUMPDIR         = ~/lfs-commands
     30else
     31  BASEDIR         = ~/lfs-systemd
     32  PDF_OUTPUT      = LFS-SYSD-BOOK.pdf
     33  NOCHUNKS_OUTPUT = LFS-SYSD-BOOK.html
     34  DUMPDIR         = ~/lfs-sysd-commands
     35endif
     36
     37book: validate profile-html
     38        @echo "Generating chunked XHTML files at $(BASEDIR)/ ..."
    2739        $(Q)xsltproc --nonet                          \
    2840      --stringparam chunk.quietly $(CHUNK_QUIET) \
     
    5466        $(Q)$(MAKE) --no-print-directory wget-list md5sums
    5567
    56 systemd: validated profile-html
    57         $(Q)xsltproc --nonet                      \
    58       --output $(RENDERTMP)/lfs-html2.xml    \
    59       --stringparam profile.revision systemd \
    60       stylesheets/lfs-xsl/profile.xsl        \
    61       $(RENDERTMP)/lfs-html.xml
    62 
    63         @echo "Generating chunked XHTML files..."
    64         $(Q)xsltproc --nonet                          \
    65       --stringparam chunk.quietly $(CHUNK_QUIET) \
    66       --stringparam rootid "$(ROOT_ID)"          \
    67       --stringparam base.dir $(SYSDDIR)/         \
    68       stylesheets/lfs-chunked.xsl                \
    69       $(RENDERTMP)/lfs-html2.xml
    70 
    71         @echo "Copying CSS code and images..."
    72         $(Q)mkdir -p $(SYSDDIR)/stylesheets
    73         $(Q)cp stylesheets/lfs-xsl/*.css $(SYSDDIR)/stylesheets
    74 
    75         $(Q)mkdir -p $(SYSDDIR)/images
    76         $(Q)cp images/*.png $(SYSDDIR)/images
    77 
    78         @echo "Running Tidy and obfuscate.sh..."
    79         $(Q)for filename in `find $(SYSDDIR) -name "*.html"`; do \
    80          tidy -config tidy.conf $$filename;           \
    81          true;                                        \
    82          /bin/bash obfuscate.sh $$filename;           \
    83          sed -e "s@text/html@application/xhtml+xml@g" \
    84              -e "s/\xa9/\&copy;/ "                    \
    85              -i $$filename;                           \
    86        done;
    87 
    88         $(Q)$(MAKE) --no-print-directory wget-listd md5sumsd
    89 
    9068pdf: validate
    9169        @echo "Generating profiled XML for PDF..."
    9270        $(Q)xsltproc --nonet \
    9371                --stringparam profile.condition pdf \
    94                 --stringparam profile.revision sysv \
    9572                --output $(RENDERTMP)/lfs-pdf.xml   \
    9673                stylesheets/lfs-xsl/profile.xsl     \
    97                 $(RENDERTMP)/lfs-full.xml
     74                $(RENDERTMP)/lfs-html2.xml
    9875
    9976        @echo "Generating FO file..."
     
    11491        @echo "fop.log created"
    11592
    116 pdfd: validated
    117         @echo "Generating profiled XML for PDF..."
    118         $(Q)xsltproc --nonet                                \
    119                  --stringparam profile.condition pdf    \
    120                  --stringparam profile.revision systemd \
    121                  --output $(RENDERTMP)/lfs-pdf.xml      \
    122                  stylesheets/lfs-xsl/profile.xsl        \
    123                  $(RENDERTMP)/lfs-full.xml
    124 
    125         @echo "Generating FO file..."
    126         $(Q)xsltproc --nonet                          \
    127                 --stringparam rootid "$(ROOT_ID)" \
    128                 --output $(RENDERTMP)/lfs-pdf.fo  \
    129                 stylesheets/lfs-pdf.xsl           \
    130                 $(RENDERTMP)/lfs-pdf.xml
    131 
    132         $(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/lfs-pdf.fo
    133         $(Q)bash pdf-fixups.sh $(RENDERTMP)/lfs-pdf.fo
    134 
    135         @echo "Generating PDF file..."
    136         $(Q)mkdir -p $(SYSDDIR)
    137 
    138         $(Q)fop -q  $(RENDERTMP)/lfs-pdf.fo $(SYSDDIR)/$(PDF_SYSD_OUTPUT) 2>fop.log
    139         @echo "$(SYSDDIR)/$(PDF_SYSD_OUTPUT) created"
    140         @echo "fop.log created"
    141 
    14293nochunks: validate profile-html
    143         $(Q)xsltproc --nonet                             \
    144                 --output $(RENDERTMP)/lfs-html2.xml \
    145                 --stringparam profile.revision sysv \
    146                 stylesheets/lfs-xsl/profile.xsl     \
    147                 $(RENDERTMP)/lfs-html.xml
    148 
    14994        @echo "Generating non chunked XHTML file..."
    15095        $(Q)xsltproc --nonet                                \
     
    166111        @echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)"
    167112
    168 nochunksd: validated profile-html
    169         $(Q)xsltproc --nonet                                \
    170                 --output $(RENDERTMP)/lfs-html2.xml    \
    171                 --stringparam profile.revision systemd \
    172                 stylesheets/lfs-xsl/profile.xsl        \
    173                 $(RENDERTMP)/lfs-html.xml
    174 
    175         @echo "Generating non chunked XHTML file..."
    176         $(Q)xsltproc --nonet                                   \
    177                 --stringparam rootid "$(ROOT_ID)"         \
    178                 --output $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE) \
    179                 stylesheets/lfs-nochunks.xsl              \
    180                 $(RENDERTMP)/lfs-html2.xml
    181 
    182         @echo "Running Tidy..."
    183         $(Q)tidy -config tidy.conf $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE) || true
    184 
    185         @echo "Running obfuscate.sh..."
    186         $(Q)bash obfuscate.sh                                $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)
    187         $(Q)sed -i -e "s@text/html@application/xhtml+xml@g"  $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)
    188         $(Q)sed -i -e "s@../wget-list@wget-list@"            $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)
    189         $(Q)sed -i -e "s@../md5sums@md5sums@"                $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)
    190         $(Q)sed -i -e "s@\xa9@\&copy;@"                      $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)
    191 
    192         @echo "Output at $(SYSDDIR)/$(NOCHUNKS_SYSD_FILE)"
    193 
    194113tmpdir:
    195114        @echo "Creating and cleaning $(RENDERTMP)"
    196115        $(Q)mkdir -p $(RENDERTMP)
    197116        $(Q)rm -f $(RENDERTMP)/lfs*.xml
    198         $(Q)rm -f $(RENDERTMP)/sysd*.xml
     117        $(Q)rm -f $(RENDERTMP)/*wget*
     118        $(Q)rm -f $(RENDERTMP)/*md5sum*
    199119        $(Q)rm -f $(RENDERTMP)/*pdf.fo
    200120
     
    202122        @echo "Processing bootscripts..."
    203123        $(Q)bash process-scripts.sh
     124
     125        @echo "Adjusting for revision $(REV)..."
     126        $(Q)xsltproc --nonet                               \
     127                --xinclude                            \
     128                --output $(RENDERTMP)/lfs-html2.xml   \
     129                --stringparam profile.revision $(REV) \
     130                stylesheets/lfs-xsl/profile.xsl       \
     131                index.xml
     132
    204133        @echo "Validating the book..."
    205134        $(Q)xmllint --nonet                      \
    206135               --noent                      \
    207                --xinclude                   \
    208136               --postvalid                  \
    209137                    -o $(RENDERTMP)/lfs-full.xml \
    210                index.xml
     138               $(RENDERTMP)/lfs-html2.xml
     139
    211140        $(Q)rm -f appendices/*.script
    212141        $(Q)./aux-file-data.sh $(RENDERTMP)/lfs-full.xml
    213         @echo "Validation complete."
    214 
    215 validated: tmpdir
    216         @echo "Validating the book..."
    217         $(Q)xmllint --nonet                      \
    218                --noent                      \
    219                --xinclude                   \
    220                --postvalid                  \
    221                     -o $(RENDERTMP)/lfs-full.xml \
    222                indexd.xml
    223142        @echo "Validation complete."
    224143
     
    229148                     --output $(RENDERTMP)/lfs-html.xml   \
    230149                stylesheets/lfs-xsl/profile.xsl      \
    231                      $(RENDERTMP)/lfs-full.xml
     150                     $(RENDERTMP)/lfs-html2.xml
    232151
    233152wget-list: $(BASEDIR)/wget-list
    234153$(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml \
    235154                      packages.ent patches.ent
    236         @echo "Generating wget list for sysv..."
     155        @echo "Generating wget list for sysv at $(BASEDIR)/wget-list ..."
    237156        $(Q)mkdir -p $(BASEDIR)
    238157
    239         $(Q)xsltproc --nonet --xinclude                  \
    240                 --stringparam profile.revision sysv \
    241                 --output $(RENDERTMP)/sysd-wget.xml \
    242                 stylesheets/lfs-xsl/profile.xsl     \
     158        $(Q)xsltproc --nonet --xinclude                    \
     159                --stringparam profile.revision $(REV) \
     160                --output $(RENDERTMP)/sysd-wget.xml   \
     161                stylesheets/lfs-xsl/profile.xsl       \
    243162                chapter03/chapter03.xml
    244163
     
    248167                chapter03/chapter03.xml
    249168
    250 wget-listd: $(SYSDDIR)/wget-listd
    251 $(SYSDDIR)/wget-listd: stylesheets/wget-list.xsl chapter03/chapter03.xml \
    252                        packages.ent patches.ent
    253         @echo "Generating wget list for systemd..."
    254         $(Q)mkdir -p $(SYSDDIR)
    255 
    256         $(Q)xsltproc --xinclude --nonet                     \
    257                 --stringparam profile.revision systemd \
    258                 --output $(RENDERTMP)/sysd-wget.xml    \
    259                 stylesheets/lfs-xsl/profile.xsl        \
    260                 chapter03/chapter03.xml
    261 
    262         $(Q)xsltproc --xinclude --nonet            \
    263                 --output $(SYSDDIR)/wget-list \
    264                 stylesheets/wget-list.xsl     \
    265                 $(RENDERTMP)/sysd-wget.xml
    266 
    267169md5sums: $(BASEDIR)/md5sums
    268170$(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \
    269171                    packages.ent patches.ent
    270         @echo "Generating md5sum file for sysv..."
     172        @echo "Generating md5sum file for sysv at $(BASEDIR)/md5sums ..."
    271173        $(Q)mkdir -p $(BASEDIR)
    272174
    273175        $(Q)xsltproc --nonet --xinclude                    \
    274                 --stringparam profile.revision sysv  \
     176                --stringparam profile.revision $(REV) \
    275177                --output $(RENDERTMP)/sysv-md5sum.xml \
    276178                stylesheets/lfs-xsl/profile.xsl       \
     
    285187       $(BASEDIR)/md5sums
    286188
    287 md5sumsd: $(SYSDDIR)/md5sums
    288 $(SYSDDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \
    289                     packages.ent patches.ent
    290         @echo "Generating md5sum file for systemd..."
    291         $(Q)mkdir -p $(SYSDDIR)
    292         $(Q)xsltproc --nonet --xinclude                     \
    293                 --stringparam profile.revision systemd \
    294                 --output $(RENDERTMP)/sysd-md5sum.xml  \
    295                 stylesheets/lfs-xsl/profile.xsl        \
    296                 chapter03/chapter03.xml
    297 
    298         $(Q)xsltproc --xinclude --nonet          \
    299                 --output $(SYSDDIR)/md5sums \
    300                      stylesheets/md5sum.xsl      \
    301                 $(RENDERTMP)/sysd-md5sum.xml
    302 
    303189dump-commands: validate
    304190        @echo "Dumping book commands..."
    305         $(Q)xsltproc --nonet                   \
    306       --output $(RENDERTMP)/lfs-html.xml  \
    307       --stringparam profile.revision sysv \
    308       stylesheets/lfs-xsl/profile.xsl     \
     191        $(Q)xsltproc --nonet                     \
     192      --output $(RENDERTMP)/lfs-html.xml    \
     193      --stringparam profile.revision $(REV) \
     194      stylesheets/lfs-xsl/profile.xsl       \
    309195      $(RENDERTMP)/lfs-full.xml
    310196
     
    316202        @echo "Dumping book commands complete in $(DUMPDIR)"
    317203
    318 dump-commandsd: validated
    319         @echo "Dumping book commands..."
    320         $(Q)xsltproc --nonet                      \
    321       --output $(RENDERTMP)/lfs-html.xml     \
    322       --stringparam profile.revision systemd \
    323       stylesheets/lfs-xsl/profile.xsl        \
    324       $(RENDERTMP)/lfs-full.xml
    325 
    326         $(Q)rm -rf $(DUMPDIR)
    327  
    328         $(Q)xsltproc --output $(DUMPDIR)/          \
    329                 stylesheets/dump-commands.xsl \
    330                 $(RENDERTMP)/lfs-html.xml
    331         @echo "Dumping book commands complete in $(DUMPDIR)"
    332 
    333 all: lfs nochunks pdf dump-commands
    334 
    335 .PHONY : all sysv systemd dump-commands lfs nochunks pdf profile-html tmpdir validate
    336 
     204all: book nochunks pdf dump-commands
     205
     206.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list
     207
Note: See TracChangeset for help on using the changeset viewer.