Makefile
branchv_0
changeset 25 8da11cce2c98
parent 20 fb939d9baaf4
child 27 413a00a9cde7
--- a/Makefile	Sat Sep 21 16:51:06 2019 +0200
+++ b/Makefile	Sat Sep 21 19:40:43 2019 +0200
@@ -13,17 +13,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+all: validate xhtml txt
+
 validate:
-	xmllint --noout --schema ssm.xsd ssm.en.xml
+	xmllint --noout --schema schema/ssm.xsd text/ssm.en.xml
+
 xhtml:
-	xsltproc --output ssm.en.xhtml --nonet ssm.xsl ssm.en.xml
+	mkdir -p build
+	xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
+	cp templates/*.css build
+
+# TODO: better line wrapping
+txt:
+	mkdir -p build
+	xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/(  +)([^- ])/\1  \2/g' > build/ssm.en.txt
 
 clean:
-	rm -f ssm.en.xhtml
+	rm -rf build
 
 publish:
-	scp ssm.en.xhtml globalcode.info:/var/www/sane-software.globalcode.info/v_0/index.xhtml
-	scp style.css    globalcode.info:/var/www/sane-software.globalcode.info/v_0/
+	scp build/* globalcode.info:/var/www/sane-software.globalcode.info/v_0/
 
 
 # Prints a table with number of items in particular chapters: