-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
107 lines (72 loc) · 1.74 KB
/
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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
PYTHON ?= python2.7
POT = plonetheme/nuplone/locales/nuplone.pot
PO_FILES = $(wildcard plonetheme/nuplone/locales/*/LC_MESSAGES/nuplone.po)
MO_FILES = $(PO_FILES:.po=.mo)
TARGETS = $(MO_FILES)
BINDIR ?= .bundle/bin
BUNDLE ?= $(BINDIR)/bundle
YARN ?= npx yarn
all: ${TARGETS}
bundle bundle.js bundles/oira.cms.js: stamp-yarn
npm run build
.PHONY: clean
clean::
-rm ${TARGETS}
rm -rf stamp-yarn node_modules bundles/*
##
# PATTERNSLIB
##
# Install patternslib
stamp-yarn:
$(YARN) install
touch stamp-yarn
# Build JavaScript bundle
.PHONY: bundle
bundle: stamp-yarn
-$(YARN) unlink @patternslib/pat-redactor
-$(YARN) unlink @patternslib/patternslib
$(YARN) install --force
$(YARN) build
cp -R ./plonetheme/nuplone/static/bundle ./Prototype
.PHONY: bundledev
bundledev: stamp-yarn
$(YARN) builddev
# Watch JavaScript for changes
.PHONY: watch
watch: stamp-yarn
$(YARN) watch
.PHONY: devln
devln:
$(YARN) link "@patternslib/patternslib"
.PHONY: undevln
undevln:
$(YARN) unlink "@patternslib/patternslib"
# OTHER
bin/buildout: bootstrap.py
$(PYTHON) bootstrap.py
bin/pybabel bin/test bin/sphinx-build: bin/buildout buildout.cfg versions.cfg setup.py
bin/buildout -t 10
touch bin/test
touch bin/sphinx-build
touch bin/pybabel
check:: bin/test ${MO_FILES}
bin/test
jenkins: bin/test bin/sphinx-build $(MO_FILES)
bin/test --xml
docs:: bin/sphinx-build
make -C docs html
clean::
rm -rf docs/.build
pot: bin/pybabel
bin/pybabel extract -F babel.cfg \
--charset=utf-8 \
plonetheme > $(POT)~
mv $(POT)~ $(POT)
$(MAKE) $(MFLAGS) $(PO_FILES)
$(PO_FILES): $(POT)
msgmerge --update $@ $<
.po.mo:
msgfmt -c --statistics -o $@~ $< && mv $@~ $@
.PHONY: all docs jenkins pot
.SUFFIXES:
.SUFFIXES: .po .mo .css .min.css