summaryrefslogtreecommitdiff
path: root/rem.mk
diff options
context:
space:
mode:
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