summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-14 23:39:44 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-14 23:39:44 +0100
commite34a4c0fde20e236093e0ad1cefd7668fff4736b (patch)
tree3182538f8a447d985fb5a8361cbefae6b042f706 /Makefile
parente273d9af2ad2432b8f7e4ec095c799bc2bfa9df7 (diff)
Updated Makefile for Website
* Improve webclean target, no longer deploy www-src and Makefile * Better documentation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files 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. <http://creativecommons.org/licenses/by-sa/4.0/>
+.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