aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cc098e6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+# Makefile for Velstandsfanden website.
+#
+# The site is mainly a faircamp site, but with a few external
+# resources. As faircamp itself is not meant to build a full
+# website, we tie it all together using a Makefile.
+#
+all: build
+
+#
+# Include local overrides
+#
+-include Makefile.local
+
+#
+# Override these variables by setting creating a "Makefile.local"
+# and defined them there. Only the variables you want to override
+# needs to be defined in Makefile.local
+#
+FAIRCAMP_BIN?=faircamp
+CATALOG_DIR?=./faircamp
+BUILD_DIR?=$(CATALOG_DIR)/.faircamp_build
+
+build:
+ $(FAIRCAMP_BIN) --catalog-dir=$(CATALOG_DIR)
+ python aggregator/aggregator.py refresh
+ cp sider/*.{html,jpg} $(BUILD_DIR)/
+
+#
+# Deploying will only work if the DEPLOY_TARGET variable is set.
+# Define it in "Makefile.local". It should typically be something
+# like:
+#
+# username@example.com:target_path
+#
+deploy: build
+ifndef DEPLOY_TARGET
+ $(error "DEPLOY_TARGET must be set!")
+endif
+ rsync -avzz $(BUILD_DIR)/* $(DEPLOY_TARGET)
+
+#
+# Since we have content external to Faircamp included in the site,
+# use a simple web server to serve the preview instead of the one
+# built into faircamp
+#
+preview: build
+ devd -a $(BUILD_DIR)