summaryrefslogtreecommitdiff
path: root/rem.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 /rem.mk
parent6549136606ba6ec2cfe91efaa00a018ce2f586d2 (diff)
downloadmakefile_templates-2637742612ebe1870032e9e15c9f317cbbdb13cf.tar.gz
makefile_templates-2637742612ebe1870032e9e15c9f317cbbdb13cf.zip
css, pandoc, and rem use dest_dir facilities
Diffstat (limited to 'rem.mk')
-rw-r--r--rem.mk12
1 files changed, 8 insertions, 4 deletions
diff --git a/rem.mk b/rem.mk
index b070616..1d8be29 100644
--- a/rem.mk
+++ b/rem.mk
@@ -4,8 +4,12 @@
CLEAN_TARGETS += clean_rem
REAL_CLEAN_TARGETS += real_clean_rem
+dest_dir_rem ?= $(dest_dir)
+destination_dirs += $(dest_dir_rem)
+
rem_files = $(wildcard *.rem)
html_from_rem = $(rem_files:%.rem=%.html)
+html_from_rem_dest_targets = $(html_from_rem:%=$(dest_dir_rem)/%)
html_rem: $(html_from_rem)
@@ -21,12 +25,12 @@ ifneq ($(strip $(html_from_rem)),)
rm -f $(html_from_rem)
endif
-dest_dir_rem:
- $(INSTALL) -d -m 0755 $(dest_dir)
-install_html_from_rem: dest_dir_rem $(html_from_rem)
+install_html_from_rem: $(html_from_rem_dest_targets)
+
+$(html_from_rem_dest_targets): $(dest_dir_rem)/% : % | $(dest_dir_rem)
ifneq ($(strip $(html_from_rem)),)
- $(INSTALL) -m 0644 $(html_from_rem) $(dest_dir)/
+ $(INSTALL) -m 0644 '$<' '$@'
endif