summaryrefslogtreecommitdiff
path: root/Makefile
blob: 47e03992ea4bb06f45bb49eef6254898ead1c64e (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
install_global=false
-include config.mk

.PHONY: all
all:
	@echo "This is a python project, no compilation required\nSCSS/SASS Initial Setup: make sass-setup\nSCSS/SASS Build (for static files): make sass-build"

.PHONY: install

ifeq ($(install_global), true)
install: install-global
else
install: install-local
endif

.PHONY: install-global
install-global: compile sass-build
	pip3 install .

.PHONY: install-local
install-local: compile sass-build
	pip3 install . --user

# run testcases
.PHONY: check
check:
	@export TALER_CONFIG_FILE=talerblog/tests.conf; \
        python3 setup.py test

.PHONY: clean
clean:
	@echo nothing to do

.PHONY: dist
dist:
	git archive --format=tar.gz HEAD -o taler-merchant-blog.tar.gz

.PHONY: pretty
pretty:
	yapf -r -i talerblog/

# i18n
extract:
#	Note: Flask-BabelEx expects 'translations/' for the dirname,
#       even though GNU gettext typically uses 'locale/'
	mkdir -p translations/
	pybabel extract -F babel.cfg -o translations/messages.pot .
#	Add new language as follows:
#	pybabel init -i locale/messages.pot -d locale/ -l de

.PHONY: compile
compile: update
	pybabel compile -d translations/

.PHONY: update
update: extract
	pybabel update -i translations/messages.pot -d translations/

# SASS/SCSS

.PHONY: sass-setup
sass-setup:
	@echo "This is the initial sass-installation/setup script."
	@echo "This setup must run as root, on a machine that has NPM installed!"
	@echo "If your password is requested (for escalation), please enter it."
	sudo npm install -g sass

.PHONY: scss-setup
scss-setup: sass-setup

.PHONY: sass-build
sass-build:
	@echo "Warning: If Sass/Scss is not installed, please run \`make sass-setup\` first!"
	@echo "This script will only convert files inside /static"
	sass talermerchantdemos/static:talermerchantdemos/static

.PHONY: scss-build
scss-build: sass-build

.PHONY: sass-autobuild
sass-autobuild:
	@echo "Warning: If Sass/Scss is not installed, please run \`make sass-setup\` first!"
	@echo "This script will automatically build sass/scss files in the static directory!"
	sass --watch talermerchantdemos/static:talermerchantdemos/static

.PHONY: scss-autobuild
scss-autobuild: sass-autobuild