summaryrefslogtreecommitdiff
path: root/css.mk
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2015-04-16 23:53:37 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2015-04-16 23:53:37 -0400
commit2637742612ebe1870032e9e15c9f317cbbdb13cf (patch)
tree91b61b14be50c05aa9b529eaa6e8826ffe3ad881 /css.mk
parent6549136606ba6ec2cfe91efaa00a018ce2f586d2 (diff)
downloadmakefile_templates-2637742612ebe1870032e9e15c9f317cbbdb13cf.tar.gz
makefile_templates-2637742612ebe1870032e9e15c9f317cbbdb13cf.zip
css, pandoc, and rem use dest_dir facilities
Diffstat (limited to 'css.mk')
-rw-r--r--css.mk18
1 files changed, 12 insertions, 6 deletions
diff --git a/css.mk b/css.mk
index f4decfa..2ae62e8 100644
--- a/css.mk
+++ b/css.mk
@@ -4,8 +4,13 @@
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)
@@ -20,16 +25,17 @@ ifneq ($(strip $(css_targets)),)
rm -f $(css_targets)
endif
-dest_dir_css:
- $(INSTALL) -d -m 0755 $(dest_dir)
+install_css: $(css_dest_targets)
-install_css: dest_dir_css
+$(css_dest_targets): $(dest_dir_css)/% : % | $(dest_dir_css)
ifneq ($(strip $(css_targets)),)
- $(INSTALL) -m 0644 $(css_targets) $(dest_dir)/
+ $(INSTALL) -m 0644 '$<' '$@'
endif
-install_css_src: dest_dir_css
+install_css_src: $(scss_src_dest_targets)
+
+$(scss_src_dest_targets): $(dest_dir_css)/% : % | $(dest_dir_css)
ifneq ($(strip $(scss_files)),)
- $(INSTALL) -m 0644 $(scss_files) $(dest_dir)/
+ $(INSTALL) -m 0644 '$<' '$@'
endif