Makefile
branchv_0
changeset 81 47717a4ed4bb
parent 77 07cd1e608525
child 82 a11239f9f9e7
equal deleted inserted replaced
80:b716698c82a0 81:47717a4ed4bb
    13 # You should have received a copy of the GNU General Public License
    13 # You should have received a copy of the GNU General Public License
    14 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
    14 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
    15 
    15 
    16 VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}') "--stringparam" "versionChangedFiles" $(shell hg status | wc -l) 
    16 VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}') "--stringparam" "versionChangedFiles" $(shell hg status | wc -l) 
    17 
    17 
    18 all: validate xhtml txt pdf logo-png statistics
    18 all: validate xhtml txt pdf build/ssm.en.epub logo-png statistics
    19 
    19 
    20 validate:
    20 validate:
    21 	xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml
    21 	xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml
    22 
    22 
    23 xhtml: templates/cmunrm.woff templates/cmunbx.woff
    23 xhtml: text/ssm.en.xml templates/cmunrm.woff templates/cmunbx.woff
    24 	mkdir -p build
    24 	mkdir -p build
    25 	xsltproc $(VERSION_PARAMS) --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
    25 	xsltproc $(VERSION_PARAMS) --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
    26 	cp templates/*.css build
    26 	cp --reflink=auto templates/*.css build
    27 	cp templates/*.woff build
    27 	cp --reflink=auto templates/*.woff build
       
    28 
       
    29 build/ssm.en.epub: text/ssm.en.xml templates/ssm.xhtml.xsl templates/cmunrm.woff templates/cmunbx.woff
       
    30 	mkdir -p "build/epub/META-INF"
       
    31 	mkdir -p "build/epub/OEBPS"
       
    32 	echo -n "application/epub+zip" > "build/epub/mimetype"
       
    33 	xsltproc \
       
    34 		--nonet \
       
    35 		--xinclude \
       
    36 		$(VERSION_PARAMS) \
       
    37 		--output "build/epub/" \
       
    38 		"templates/ssm.epub.xsl" \
       
    39 		$(<)
       
    40 	cp --reflink=auto templates/*.css "build/epub/OEBPS/"
       
    41 	cp --reflink=auto templates/*.woff "build/epub/OEBPS/"
       
    42 	cd "build/epub/"; zip -r ../../$(@) \
       
    43 		-X \
       
    44 		--suffixes mimetype:jpg:jpeg:png:gif \
       
    45 		mimetype "META-INF/" "OEBPS/"
    28 
    46 
    29 templates/cmunrm.ttf:
    47 templates/cmunrm.ttf:
    30 	cd templates/; ln -s /usr/share/fonts/truetype/cmu/cmunrm.ttf
    48 	cd templates/; ln -s /usr/share/fonts/truetype/cmu/cmunrm.ttf
    31 
    49 
    32 templates/cmunbx.ttf:
    50 templates/cmunbx.ttf:
    55 
    73 
    56 clean:
    74 clean:
    57 	rm -rf build
    75 	rm -rf build
    58 
    76 
    59 publish:
    77 publish:
    60 	scp build/*     globalcode.info:/var/www/sane-software.globalcode.info/v_0/
    78 	scp build/*.*     globalcode.info:/var/www/sane-software.globalcode.info/v_0/
    61 	scp license/*   globalcode.info:/var/www/sane-software.globalcode.info/license/
    79 	scp license/*.*   globalcode.info:/var/www/sane-software.globalcode.info/license/
    62 
    80 
    63 
    81 
    64 # Described at: https://relational-pipes.globalcode.info/v_0/examples-in-xmltable-ssm-gui.xhtml
    82 # Described at: https://relational-pipes.globalcode.info/v_0/examples-in-xmltable-ssm-gui.xhtml
    65 build/statistics.rp: text/ssm.en.xml
    83 build/statistics.rp: text/ssm.en.xml
    66 	mkdir -p build
    84 	mkdir -p build