Annotation of CSS/CSS2.1-test-suite/Makefile, revision 1.15

1.15    ! fantasai    1: OFFICIAL =
        !             2: # Set to true to build for w3.org's official copy
        !             3: 
        !             4: all: stage process generate clean
        !             5: 
        !             6: stage:
1.4       ihickson    7:        #
1.3       ihickson    8:        # empty staging area
1.4       ihickson    9:        #
1.3       ihickson   10:        rm -rf tests/
                     11:        mkdir tests
1.4       ihickson   12:        #
1.3       ihickson   13:        # take raw and cooked tests and place them in staging area, along with support files
1.4       ihickson   14:        #
1.1       ihickson   15:        find raw-tests -name FILENAMES | xargs -n 1 perl make-proper-tests.pl
1.2       ihickson   16:        find cooked-tests -name '*.xht' | xargs -n 1 --replace cp -Lv {} tests
1.6       ihickson   17:        find cooked-tests/* -maxdepth 0 -type d -not -name CVS | xargs -n 1 perl -e 'if (-d "$$ARGV[0]/support") { print `cp -Lrvu "$$ARGV[0]/support" tests` }'
1.4       ihickson   18:        #
1.5       ihickson   19:        # nuke unused support files and CVS directories
1.4       ihickson   20:        #
1.1       ihickson   21:        rm -rf tests/support/.unused
1.2       ihickson   22:        find tests -type d -name CVS | xargs rm -rf
1.15    ! fantasai   23: 
        !            24: process:
1.4       ihickson   25:        #
1.14      fantasai   26:        # preprocess tests as necessary
                     27:        #
                     28:        egrep -l '&\w+;' tests/*.xht | xargs perl -pi -e 'use HTML::Entities::Numbered;' -e '$$_ = name2decimal_xml($$_)'
1.15    ! fantasai   29: 
        !            30: generate:
1.14      fantasai   31:        #
1.3       ihickson   32:        # empty distribution area
1.4       ihickson   33:        #
1.1       ihickson   34:        rm -rf dist/
                     35:        mkdir dist
1.8       fantasai   36:        mkdir dist/html4
                     37:        mkdir dist/xhtml1
                     38:        mkdir dist/xhtml1print
1.4       ihickson   39:        #
1.12      fantasai   40:        # indexes and htaccess
1.9       fantasai   41:        #
                     42:        perl catalog.pl tests/*.xht
                     43:        cp data/indices.css dist/indices.css
1.10      fantasai   44:        cp data/index.xht dist/index.xht
                     45:        cp data/index.html dist/index.html
1.12      fantasai   46:        cp data/htaccess dist/.htaccess
1.15    ! fantasai   47: ifdef OFFICIAL
        !            48:        cp data/LICENSE-W3CD dist/LICENSE-W3CD
        !            49: else
        !            50:        cp data/LICENSE-BSD dist/LICENSE-BSD
        !            51: endif
1.9       fantasai   52:        #
1.3       ihickson   53:        # generate the tests in all supported formats, along with support files
1.4       ihickson   54:        #
1.1       ihickson   55:        perl generate.pl tests/*.xht
1.9       fantasai   56:        perl -pi -e 's/\.xht/\.htm/g' dist/html4/by-section.htm
1.8       fantasai   57:        cp -Lrv tests/support dist/html4/support
                     58:        cp -Lrv tests/support dist/xhtml1/support
                     59:        cp -Lrv tests/support dist/xhtml1print/support
1.11      fantasai   60:         # PNG->JPEG conversion requires ImageMagick's 'convert' tool
1.13      bbos       61:        find dist/xhtml1print/support -iname '*.png' | xargs -iFILENAME convert FILENAME -background white -flatten -quality 90 -interlace none FILENAME.jpg
1.8       fantasai   62:        find dist/xhtml1print/support -iname '*.png.jpg' | xargs rename s/png.jpg/jpg/
                     63:        find dist/xhtml1print/support -iname '*.png' | xargs rm -rf
                     64:        find dist/xhtml1print -iname '*.xht' -o -iname '*.css' | xargs perl -pi -e 's/\.png/\.jpg/g'
1.4       ihickson   65:        #
1.15    ! fantasai   66:        # report number of tests now included (XHTML1.1 variants only)
        !            67:        #
        !            68:        ls dist/xhtml1/*.xht | wc -l
        !            69: ifdef OFFICIAL
        !            70:        @echo "Built as official copy"
        !            71: endif
        !            72: 
        !            73: 
        !            74: clean:
        !            75:        #
1.3       ihickson   76:        # empty staging area again
1.4       ihickson   77:        #
1.3       ihickson   78:        rm -rf tests/
1.15    ! fantasai   79: 
        !            80: official:
        !            81:        # For lazy typists
        !            82:        make OFFICIAL=true

Webmaster