-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
43 lines (32 loc) · 987 Bytes
/
Makefile
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
PROJECTS := cubes brewery bubbles blog
HOME := home
BUILD_PATH := _build
CONF_LOCAL := pelicanconf.py
CONF_PUBLISH := publishconf.py
#########################################################
-include Makefile.local
ALL_TARGETS := $(PROJECTS) $(HOME)
PUBLISH_TARGETS := $(addprefix publish_, $(PROJECTS))
CONFIG := $(CONF_LOCAL)
.PHONY: all $(PROJECTS) $(HOME)
all: $(PROJECTS) home
build: CONFIG := $(CONF_PUBLISH)
build: MSG := "final "
build: $(PROJECTS) home
publish: build rsync
$(PROJECTS) home:
@echo Creating $(MSG)content for $@... ; \
cd $@ ; \
pelican content -s $(CONFIG)
rsync: check-publish-target
@echo Publishing... ; \
for target in $(PROJECTS) ; do \
echo Syncing $$target ; \
rsync -r $(BUILD_PATH)/$$target/ $(PUBLISH_TARGET)/$$target ; \
done ; \
echo Syncing home... ; \
rsync -r $(BUILD_PATH)/$(HOME)/ $(PUBLISH_TARGET)
check-publish-target:
ifndef PUBLISH_TARGET
$(error PUBLISH_TARGET is undefined. You can add it to Makefile.local)
endif