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

prefix = /usr

all: themes.json css

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

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

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

css: publik-base-theme/static/includes/_data_uris.scss $(shell python get_themes.py)
	rm -rf static/*/.sass-cache/
	for inode2 in  $(shell ls -d templates/variants/*/) ; do \
		if [ -f $$inode2/prepare-template.py ]; then \
			cd $$inode2 && python prepare-template.py; \
			cd ../../..; \
		fi \
        done

clean:
	rm -rf sdist

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/imio
	cp -r static templates themes.json $(DESTDIR)$(prefix)/share/publik/themes/imio
	rm $(DESTDIR)$(prefix)/share/publik/themes/imio/static/*/config.json

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))