# Makefile for compiling the Ousía Homepage # # (c) Andreas Stöckel, 2015 # # This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 # International License. .PHONY: all clean webclean # Fetch all the source OSML files in the top level directory SOURCE_OSML=$(wildcard *.osml) # Derive the target xml and html files from the source files TARGET_XML=$(SOURCE_OSML:.osml=.xml) TARGET_HTML=$(SOURCE_OSML:.osml=.html) # Builds the style and all webpages all: script/ousia.js style/style.css $(TARGET_XML) $(TARGET_HTML) # Build the stylesheet using lessc # On Fedora you can install lessc using the following commands (as root): # yum install nodejs npm # npm install -g less less-plugin-clean-css style/style.css: style/*.less style/lib/*.css lessc \ style/style.less \ style/style.css --clean-css="--s1" # Build the JavaScript using uglifyjs # On Fedora you can install uglifyjs using the following commands (as root): # yum install nodejs npm # npm install -g uglifyjs script/ousia.js: script/lib/*.js uglifyjs \ script/lib/prism.js \ script/lib/prism_bash.js \ script/highlight.js > script/ousia.js # Compile all osml files to xml %.xml: %.osml ontology/*.osml ousia -F xml -o $@ $< # Compile the xml files to html %.html: %.xml xsl/*.xsl xsltproc xsl/webpage.xsl $< > $@ # Clean script, remove all target files clean: rm -f style/*.css rm -f script/ousia.js rm -f $(TARGET_HTML) rm -f $(TARGET_XML) rm -f *~ style/*~ ontology/*~ xsl/*~ # Webclean script -- deletes all source files, keeping only the compiled HTML, # CSS and JS code. It is generally a good idea to remove the source files from # the webserver directory to keep people from downloading potentially large # source files and to reduce time for deployment (gzip, rsync). webclean: # Avoid accidential execution of this target -- delete the .git folder if # you really want to delete all development files and prepare this folder # for deployment on a webserver test ! -e .git find style/ -type f -not -name "style.css" -delete find script/ -type f -not -name "ousia.js" -delete rmdir script/lib rmdir style/lib rm -f $(TARGET_XML) rm -f $(SOURCE_OSML) rm -rf ontology www-src rm -f Makefile rm -f .gitignore