Makefile
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Sep 2019 20:34:51 +0200
branchv_0
changeset 27 413a00a9cde7
parent 25 8da11cce2c98
child 30 841bec790da8
permissions -rw-r--r--
merge two sections into Semantic versioning and upgrades + remove obvious requiremts/recommendations + rename the compatibility section
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Sane Software Manifesto helper tools
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    16
all: validate xhtml txt
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    17
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
validate:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    19
	xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    20
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
xhtml:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    22
	mkdir -p build
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    23
	xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    24
	cp templates/*.css build
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    26
# TODO: better line wrapping
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    27
txt:
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    28
	mkdir -p build
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    29
	xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/(  +)([^- ])/\1  \2/g' > build/ssm.en.txt
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
clean:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    32
	rm -rf build
18
f315b3d27a9d make: publish
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    33
f315b3d27a9d make: publish
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    34
publish:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents: 20
diff changeset
    35
	scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/
20
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    36
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    37
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    38
# Prints a table with number of items in particular chapters:
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    39
statistics:
27
413a00a9cde7 merge two sections into Semantic versioning and upgrades
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    40
	cat text/ssm.en.xml \
20
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    41
	    | relpipe-in-xmltable \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    42
		--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    43
		--relation "chapter" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    44
		    --records "//m:chapter" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    45
		    --attribute "name" string "m:name" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    46
		    --attribute "item_count" integer "count(descendant::m:item)" \
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    47
	    | relpipe-out-tabular
fb939d9baaf4 make: statistics (just for fun)
František Kučera <franta-hg@frantovo.cz>
parents: 18
diff changeset
    48
# try also relpipe-out-gui to get the chart