summaryrefslogtreecommitdiff
path: root/Makefile
blob: d738e774ec301e27c92fa1918772a33fb4f9ed89 (plain)
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
#!/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.