Makefile
author Ville Skyttä <ville.skytta@iki.fi>
Tue, 29 Jun 2010 21:42:45 +0300
changeset 3107 f7494ae35248
parent 3106 a634c95910f8
child 3180 13be4ea042d6
permissions -rw-r--r--
Add "reminder" check for version in various files in "make dist".
3106
a634c95910f8 Get version from the check script instead of bundle.
Ville Skyttä <ville.skytta@iki.fi>
parents: 3075
diff changeset
     1
VERSION = $(shell perl -ne '/^\$$VERSION\b.*?([\d.]+)/ && print $$1' httpd/cgi-bin/check)
2974
4828e0f44dc0 Add dist target.
ville
parents: 2972
diff changeset
     2
2936
a895ac1d11c1 Add perltidy(1) settings and a simple Makefile target for running it.
ville
parents:
diff changeset
     3
PERL_FILES = httpd/cgi-bin/check httpd/cgi-bin/sendfeedback.pl \
3058
16a6e9abe911 Add crude script for converting SGML Open Catalogs to XML catalogs.
ville
parents: 3026
diff changeset
     4
	misc/soc2xml.pl misc/spmpp.pl misc/docs_errors.pl \
16a6e9abe911 Add crude script for converting SGML Open Catalogs to XML catalogs.
ville
parents: 3026
diff changeset
     5
	misc/bundle/Makefile.PL misc/bundle/lib/Bundle/W3C/Validator.pm
2936
a895ac1d11c1 Add perltidy(1) settings and a simple Makefile target for running it.
ville
parents:
diff changeset
     6
2937
f55b47ae1c23 Make perltidy backup/modify-in-place.
ville
parents: 2936
diff changeset
     7
PERLTIDY = perltidy --profile=misc/perltidyrc --backup-and-modify-in-place
2945
c8c09366077e Add perlcritic(1) profile and a Makefile target for running it.
ville
parents: 2944
diff changeset
     8
PERLCRITIC = perlcritic --profile misc/perlcriticrc
2937
f55b47ae1c23 Make perltidy backup/modify-in-place.
ville
parents: 2936
diff changeset
     9
2972
5997b2e905b0 Add test target for running the test suite.
ville
parents: 2945
diff changeset
    10
VALIDATOR_URI = http://localhost/w3c-validator/check
5997b2e905b0 Add test target for running the test suite.
ville
parents: 2945
diff changeset
    11
3075
ba653e217e4e Add target for generating catalog.xml.
ville
parents: 3058
diff changeset
    12
all: htdocs/docs/errors.html htdocs/sgml-lib/catalog.xml
3026
e38f7ac74297 Add target for generating htdocs/docs/errors.html, do it in "all", do "all" in "dist".
ville
parents: 2976
diff changeset
    13
e38f7ac74297 Add target for generating htdocs/docs/errors.html, do it in "all", do "all" in "dist".
ville
parents: 2976
diff changeset
    14
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
e38f7ac74297 Add target for generating htdocs/docs/errors.html, do it in "all", do "all" in "dist".
ville
parents: 2976
diff changeset
    15
	env W3C_VALIDATOR_HOME=. W3C_VALIDATOR_CFG=htdocs/config/validator.conf misc/docs_errors.pl > $@
2936
a895ac1d11c1 Add perltidy(1) settings and a simple Makefile target for running it.
ville
parents:
diff changeset
    16
3075
ba653e217e4e Add target for generating catalog.xml.
ville
parents: 3058
diff changeset
    17
htdocs/sgml-lib/catalog.xml: misc/soc2xml.pl htdocs/sgml-lib/xml.soc
ba653e217e4e Add target for generating catalog.xml.
ville
parents: 3058
diff changeset
    18
	misc/soc2xml.pl < htdocs/sgml-lib/xml.soc > $@
ba653e217e4e Add target for generating catalog.xml.
ville
parents: 3058
diff changeset
    19
2972
5997b2e905b0 Add test target for running the test suite.
ville
parents: 2945
diff changeset
    20
test:
5997b2e905b0 Add test target for running the test suite.
ville
parents: 2945
diff changeset
    21
	misc/testsuite/harness.py --validator_uri=$(VALIDATOR_URI) run
5997b2e905b0 Add test target for running the test suite.
ville
parents: 2945
diff changeset
    22
2945
c8c09366077e Add perlcritic(1) profile and a Makefile target for running it.
ville
parents: 2944
diff changeset
    23
perlcritic:
c8c09366077e Add perlcritic(1) profile and a Makefile target for running it.
ville
parents: 2944
diff changeset
    24
	$(PERLCRITIC) $(PERL_FILES)
c8c09366077e Add perlcritic(1) profile and a Makefile target for running it.
ville
parents: 2944
diff changeset
    25
2939
346d705fa833 Rename tidy Makefile target to perltidy.
ville
parents: 2937
diff changeset
    26
perltidy:
2944
59f2f3666ed0 Improve "make perltidy" output.
ville
parents: 2939
diff changeset
    27
	@for file in $(PERL_FILES) ; do \
59f2f3666ed0 Improve "make perltidy" output.
ville
parents: 2939
diff changeset
    28
		echo "$(PERLTIDY) $$file" ; \
2937
f55b47ae1c23 Make perltidy backup/modify-in-place.
ville
parents: 2936
diff changeset
    29
		$(PERLTIDY) $$file ; \
2936
a895ac1d11c1 Add perltidy(1) settings and a simple Makefile target for running it.
ville
parents:
diff changeset
    30
	done
2974
4828e0f44dc0 Add dist target.
ville
parents: 2972
diff changeset
    31
3026
e38f7ac74297 Add target for generating htdocs/docs/errors.html, do it in "all", do "all" in "dist".
ville
parents: 2976
diff changeset
    32
dist: all
3107
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    33
	@for file in htdocs/footer.html htdocs/whatsnew.html \
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    34
		httpd/cgi-bin/check share/templates/*/footer.tmpl ; do \
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    35
		grep -qF "$(VERSION)" $$file || { \
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    36
		echo "Validator version in $$file seems out of date." ; \
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    37
		exit 1 ; } ; \
f7494ae35248 Add "reminder" check for version in various files in "make dist".
Ville Skyttä <ville.skytta@iki.fi>
parents: 3106
diff changeset
    38
	done
2974
4828e0f44dc0 Add dist target.
ville
parents: 2972
diff changeset
    39
	misc/mkrelease.sh $(VERSION)