summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..d738e77
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+#!/usr/bin/make -f
+# Preview in local how it will render.
+preview prev: -all-dev-watch
+
+# Upload to prod.
+show: -all-prod -install-prod
+
+# Prepare.
+prepare: -prepare
+
+.PHONY: preview prev show prepare
+#*****************************************************************************#
+# Internal rules #
+#*****************************************************************************#
+ BUNDLE := bundle
+ JEK := $(BUNDLE) exec jekyll
+ ROOT := thcolor.touhey.pro:thcolor_www
+
+# Prepare.
+
+ -prepare:
+ $(BUNDLE) check || $(BUNDLE) install --path vendor/bundle
+
+# Make it and watch or not.
+
+ -all-prod: -prepare
+ $(JEK) build $(OPTS)
+ -all-dev-watch: -prepare
+ $(JEK) serve --drafts --watch $(OPTS)
+
+# Install the prod site onto the prod server.
+
+ -install-prod:
+ find _site -type f -exec chmod 644 {} \;
+ rsync -Prlt --delete --exclude=up/ _site/ "$(ROOT)"
+
+.PHONY: -prepare
+.PHONY: -all-prod -all-dev-watch
+.PHONY: -install-prod
+# End of file.