Changeset efe19ba


Ignore:
Timestamp:
06/01/2016 07:02:11 PM (8 years ago)
Author:
Bruce Dubbs <bdubbs@…>
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
Message:

UPdate Makefile to support systemd merge

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@17421 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r71a97607 refe19ba  
    66
    77# 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
     8RENDERTMP   ?= $(HOME)/tmp
     9CHUNK_QUIET  = 1
     10ROOT_ID      =
     11SHELL        = /bin/bash
    1612
    1713ALLXML := $(filter-out $(RENDERTMP)/%, \
     
    2622endif
    2723
     24ifndef REV
     25  REV = sysv
     26endif
     27
     28ifneq ($(REV), sysv)
     29  ifneq ($(REV), systemd)
     30    $(error REV must be 'sysv' (default) or 'systemd'.)
     31  endif
     32endif
     33
     34ifeq ($(REV), sysv)
     35  BASEDIR         ?= $(HOME)/public_html/blfs-book
     36  NOCHUNKS_OUTPUT ?= blfs-book.html
     37  DUMPDIR         ?= ~/blfs-commands
     38else
     39  BASEDIR         ?= $(HOME)/public_html/blfs-systemd
     40  NOCHUNKS_OUTPUT ?= blfs-sysd-book.html
     41  DUMPDIR         ?= ~/blfs-sysd-commands
     42endif
     43
     44
    2845blfs: html wget-list
    29 #all: blfs nochunks pdf
     46
    3047all: blfs nochunks
    3148world: all blfs-patch-list dump-commands test-links
     
    3451$(BASEDIR)/index.html: $(RENDERTMP)/blfs-html.xml
    3552        @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
    3959
    4060        @echo "Copying CSS code and images..."
    4161        $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
    42           mkdir -p $(BASEDIR)/stylesheets; \
    43         fi;
     62      mkdir -p $(BASEDIR)/stylesheets;          \
     63   fi;
     64
    4465        $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
     66
    4567        $(Q)if [ ! -e $(BASEDIR)/images ]; then \
    46           mkdir -p $(BASEDIR)/images; \
    47         fi;
     68      mkdir -p $(BASEDIR)/images;          \
     69   fi;
    4870        $(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
    5175
    5276        @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;
    8083
    8184nochunks: $(BASEDIR)/$(NOCHUNKS_OUTPUT)
    8285$(BASEDIR)/$(NOCHUNKS_OUTPUT): $(RENDERTMP)/blfs-html.xml
    8386        @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
    8792
    8893        @echo "Running Tidy and obfuscate.sh on non-chunked XHTML..."
    8994        $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
    9095        $(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)
    9397
    9498tmpdir: $(RENDERTMP)
     
    100104        @echo "Cleaning $(RENDERTMP)"
    101105        $(Q)rm -f $(RENDERTMP)/blfs-{full,html}.xml
    102 #       $(Q)rm -f $(RENDERTMP)/blfs-{full,html,pdf}.xml
    103 #       $(Q)rm -f $(RENDERTMP)/blfs-pdf.fo
    104106        $(Q)rm -f $(RENDERTMP)/blfs-{patch-list,patches}
    105         $(Q)rmdir $(RENDERTMP) 2>/dev/null || :
    106 
    107 validxml: $(RENDERTMP)/blfs-full.xml
     107
     108validate: $(RENDERTMP)/blfs-full.xml
    108109$(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
    109120        @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
    113126
    114127profile-html: $(RENDERTMP)/blfs-html.xml
    115128$(RENDERTMP)/blfs-html.xml: $(RENDERTMP)/blfs-full.xml
    116129        @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
    120135
    121136blfs-patch-list: blfs-patches.sh
     
    126141blfs-patches.sh: $(RENDERTMP)/blfs-full.xml
    127142        @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
    130147
    131148wget-list: $(BASEDIR)/wget-list
    132149$(BASEDIR)/wget-list: $(RENDERTMP)/blfs-full.xml
    133         @echo "Generating wget list..."
     150        @echo "Generating wget list for $(REV) at $(BASEDIR)/wget-list ..."
    134151        $(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
    137156
    138157test-links: $(BASEDIR)/test-links
     
    140159        @echo "Generating test-links file..."
    141160        $(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
    145166
    146167        @echo "Checking URLs, first pass..."
    147168        $(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
    154177
    155178        @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
    162187
    163188bootscripts:
    164189        @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;   \
    172197   fi
    173198
     
    175200$(DUMPDIR): $(RENDERTMP)/blfs-full.xml
    176201        @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
    179205        $(Q)touch $(DUMPDIR)
    180206
    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.