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

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.17      fantasai   29:        #
                     30:        # now catalog them
                     31:        #
                     32:        perl catalog.pl tests/*.xht
1.15      fantasai   33: 
                     34: generate:
1.14      fantasai   35:        #
1.3       ihickson   36:        # empty distribution area
1.4       ihickson   37:        #
1.1       ihickson   38:        rm -rf dist/
                     39:        mkdir dist
1.8       fantasai   40:        mkdir dist/html4
                     41:        mkdir dist/xhtml1
                     42:        mkdir dist/xhtml1print
1.4       ihickson   43:        #
1.17      fantasai   44:        # documentation and htaccess
1.9       fantasai   45:        #
                     46:        cp data/indices.css dist/indices.css
1.12      fantasai   47:        cp data/htaccess dist/.htaccess
1.15      fantasai   48: ifdef OFFICIAL
                     49:        cp data/LICENSE-W3CD dist/LICENSE-W3CD
1.18    ! fantasai   50:        tpage --relative --define path=data/ --define official=true data/index.xht > dist/index.xht
        !            51:        tpage --relative --define path=data/ --define official=true data/index.html > dist/index.html
1.15      fantasai   52: else
                     53:        cp data/LICENSE-BSD dist/LICENSE-BSD
1.18    ! fantasai   54:        tpage --relative --define path=data/ data/index.xht > dist/index.xht
        !            55:        tpage --relative --define path=data/ data/index.html > dist/index.html
1.15      fantasai   56: endif
1.9       fantasai   57:        #
1.3       ihickson   58:        # generate the tests in all supported formats, along with support files
1.4       ihickson   59:        #
1.1       ihickson   60:        perl generate.pl tests/*.xht
1.9       fantasai   61:        perl -pi -e 's/\.xht/\.htm/g' dist/html4/by-section.htm
1.8       fantasai   62:        cp -Lrv tests/support dist/html4/support
                     63:        cp -Lrv tests/support dist/xhtml1/support
                     64:        cp -Lrv tests/support dist/xhtml1print/support
1.11      fantasai   65:         # PNG->JPEG conversion requires ImageMagick's 'convert' tool
1.13      bbos       66:        find dist/xhtml1print/support -iname '*.png' | xargs -iFILENAME convert FILENAME -background white -flatten -quality 90 -interlace none FILENAME.jpg
1.8       fantasai   67:        find dist/xhtml1print/support -iname '*.png.jpg' | xargs rename s/png.jpg/jpg/
                     68:        find dist/xhtml1print/support -iname '*.png' | xargs rm -rf
                     69:        find dist/xhtml1print -iname '*.xht' -o -iname '*.css' | xargs perl -pi -e 's/\.png/\.jpg/g'
1.4       ihickson   70:        #
1.15      fantasai   71:        # report number of tests now included (XHTML1.1 variants only)
                     72:        #
                     73:        ls dist/xhtml1/*.xht | wc -l
                     74: ifdef OFFICIAL
                     75:        @echo "Built as official copy"
                     76: endif
                     77: 
                     78: 
                     79: clean:
                     80:        #
1.3       ihickson   81:        # empty staging area again
1.4       ihickson   82:        #
1.3       ihickson   83:        rm -rf tests/
1.15      fantasai   84: 
                     85: official:
                     86:        # For lazy typists
                     87:        make OFFICIAL=true

Webmaster