From e34a4c0fde20e236093e0ad1cefd7668fff4736b Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 14 Mar 2015 23:39:44 +0100 Subject: Updated Makefile for Website * Improve webclean target, no longer deploy www-src and Makefile * Better documentation --- Makefile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3aaaf6e..2bd831d 100644 --- a/Makefile +++ b/Makefile @@ -5,17 +5,22 @@ # 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) -.PHONY: all +# Builds the style and all webpages all: 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 +# npm install -g less less-plugin-clean-css style/style.css: style/*.less lessc style/style.less style/style.css --clean-css="--s1" @@ -27,17 +32,25 @@ style/style.css: style/*.less %.html: %.xml xsl/*.xsl xsltproc xsl/webpage.xsl $< > $@ -# Clean script -.PHONY: clean webclean +# Clean script, remove all target files clean: rm -f style/*.css 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 rm -f style/*.less rm -f $(TARGET_XML) rm -f $(SOURCE_OSML) - rm -rf ontology + rm -rf ontology www-src + rm -f Makefile -- cgit v1.2.3