aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: cc098e6c7e65a8d9cf316d43713e9ef9758f2235 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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)