summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: d4b170f04ec163aac1df4398a422240e682e9213 (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
VERSION=`git describe | sed 's/^v//; s/-/./g' `
NAME="rouen-publik-theme"

prefix = /usr

all: themes.json css

themes.json: $(wildcard static/*/config.json)
	python3 publik-base-theme/create_themes_json.py --overlay rouen

%.css: export LC_ALL=C.UTF-8
.SECONDEXPANSION:
%.css: %.scss $$(wildcard $$(@D)/*.scss)
	sassc $< $@

publik-base-theme/static/includes/_data_uris.scss: $(wildcard publik-base-theme/static/includes/img/*)
	cd publik-base-theme; python3 make_data_uris.py static/includes/

css: publik-base-theme/static/includes/_data_uris.scss $(shell python3 get_themes.py)
	rm -rf static/*/.sass-cache/

clean:
	rm -rf sdist
	rm -f static/rouen/_data_uris.scss
	rm -rf sdist publik-base-theme/static/includes/_data_uris.scss

DIST_FILES = \
	Makefile \
	publik-base-theme \
	static templates \
	get_themes.py

dist: clean
	-mkdir sdist
	rm -rf sdist/$(NAME)-$(VERSION)
	mkdir -p sdist/$(NAME)-$(VERSION)
	for i in $(DIST_FILES); do \
		cp -R "$$i" sdist/$(NAME)-$(VERSION); \
	done

install:
	mkdir -p $(DESTDIR)$(prefix)/share/publik/themes/rouen/
	cp -r static templates themes.json $(DESTDIR)$(prefix)/share/publik/themes/rouen

dist-bzip2: dist
	-mkdir sdist
	cd sdist && tar cfj ../sdist/$(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)

version:
	@(echo $(VERSION))

name:
	@(echo $(NAME))

fullname:
	@(echo $(NAME)-$(VERSION))