1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
VERSION = $(shell perl -ne '/^\$$VERSION\b.*?([\d.]+)/ && print $$1' httpd/cgi-bin/check)
CSS_FILES = htdocs/style/base.css htdocs/style/results.css
JS_SOURCES = htdocs/scripts/mootools-1.2.5-core-nc.js \
htdocs/scripts/mootools-1.2.5.1-more.js htdocs/scripts/w3c-validator.js
PERL_FILES = httpd/cgi-bin/check httpd/cgi-bin/sendfeedback.pl \
httpd/mod_perl/startup.pl misc/soc2xml.pl misc/spmpp.pl \
misc/docs_errors.pl misc/bundle/Makefile.PL \
misc/bundle/lib/Bundle/W3C/Validator.pm
GZIP_FILES = $(addsuffix .gz,$(CSS_FILES)) htdocs/scripts/combined.js.gz
PERLTIDY = perltidy --profile=misc/perltidyrc --backup-and-modify-in-place
PERLCRITIC = perlcritic --profile misc/perlcriticrc
YUICOMPRESSOR = java -jar /usr/share/yui-compressor/yui-compressor.jar
GZIP = gzip -9n
VALIDATOR_URI = http://localhost/w3c-validator/check
# Override the above variables in config.mk if needed.
-include config.mk
all: htdocs/docs/errors.html $(GZIP_FILES)
htdocs/docs/errors.html: misc/docs_errors.pl share/templates/en_US/error_messages.cfg share/templates/en_US/docs_errors.tmpl htdocs/config/validator.conf
mkdir debian/tmp
env W3C_VALIDATOR_HOME=. W3C_VALIDATOR_CFG=htdocs/config/validator.conf perl -T misc/docs_errors.pl > $@
htdocs/scripts/combined.js: $(JS_SOURCES)
rm -f $@
@for src in $(JS_SOURCES) ; do \
echo "$(YUICOMPRESSOR) $$src >> $@" ; \
$(YUICOMPRESSOR) $$src >> $@ ; \
done
.css.css.gz .js.js.gz:
$(GZIP) -c $< > $@ && touch -r $< $@
test:
misc/testsuite/harness.py --validator_uri=$(VALIDATOR_URI) run
perlcritic:
$(PERLCRITIC) $(PERL_FILES)
perltidy:
@for file in $(PERL_FILES) ; do \
echo "$(PERLTIDY) $$file" ; \
$(PERLTIDY) $$file ; \
done
clean:
rm -f $(GZIP_FILES)
dist: all
@for file in htdocs/footer.html htdocs/whatsnew.html \
httpd/cgi-bin/check share/templates/*/footer.tmpl ; do \
grep -qF "$(VERSION)" $$file || { \
echo "Validator version in $$file seems out of date." ; \
exit 1 ; } ; \
done
misc/mkrelease.sh $(VERSION)
.SUFFIXES: .css .css.gz .js .js.gz
|