summaryrefslogtreecommitdiff
path: root/css.mk
blob: 2ae62e86aecdcd2e5831ee4f9acd278de882e2f6 (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
# -*- make -*-
# (C) 2013 by Eugeniy Mikhailov, <evgmik@gmail.com>

CLEAN_TARGETS      += clean_css
REAL_CLEAN_TARGETS += real_clean_css

dest_dir_css ?= $(dest_dir)
destination_dirs += $(dest_dir_css)

scss_files  = $(wildcard *.scss)
css_targets = $(scss_files:%.scss=%.css)
scss_src_dest_targets = $(scss_files:%=$(dest_dir_css)/%)
css_dest_targets = $(css_targets:%=$(dest_dir_css)/%)

css: $(css_targets)

$(css_targets): %.css : %.scss
	sass $<   > $@

clean_css:
	rm -rf .sass-cache

real_clean_css:
ifneq ($(strip $(css_targets)),)
	rm -f $(css_targets)
endif

install_css: $(css_dest_targets)

$(css_dest_targets): $(dest_dir_css)/% : % | $(dest_dir_css)
ifneq ($(strip $(css_targets)),)
	$(INSTALL) -m 0644 '$<' '$@'
endif

install_css_src: $(scss_src_dest_targets)

$(scss_src_dest_targets): $(dest_dir_css)/% : % | $(dest_dir_css)
ifneq ($(strip $(scss_files)),)
	$(INSTALL) -m 0644 '$<' '$@'
endif