forked from AFPy/pyconfr-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.32 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 loc) · 1.32 KB
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
48
49
50
51
52
53
54
55
56
57
58
PELICANOPTS=
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output
CONFFILE=$(BASEDIR)/pelicanconf.py
PUBLISHCONF=$(BASEDIR)/publishconf.py
AFPY_OUTPUTDIR=$(BASEDIR)/output/
AFPY_PUBLISH_URL=pyconfr@pyconfr:pyconfr-2018/
VENV := $(shell echo $${VIRTUAL_ENV-$(shell pwd)/.venv})
VIRTUALENV = virtualenv
INSTALL_STAMP = $(VENV)/.install.stamp
PYTHON=$(VENV)/bin/python
PELICAN=$(VENV)/bin/pelican
PIP=$(VENV)/bin/pip
DEBUG ?= 0
ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(PYTHON) requirements.txt
$(VENV)/bin/pip install -r requirements.txt
touch $(INSTALL_STAMP)
virtualenv: $(PYTHON)
$(PYTHON):
$(VIRTUALENV) $(VENV)
html: install
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
clean:
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
rm -rf $(VENV)
serve: install
ifdef PORT
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server $(PORT)
else
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server 8000
endif
regenerate:
cd $(OUTPUTDIR) && $(PYTHON) -m pelican.server &
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
publish: install
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
afpy: publish
rsync -avz -e ssh $(AFPY_OUTPUTDIR) $(AFPY_PUBLISH_URL) --delete
.PHONY: html clean serve devserver publish afpy