summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2015-04-17 16:33:37 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2015-04-17 16:34:06 -0400
commita4d24e574d078dac6b2e3e9046406e24935019f0 (patch)
tree6117f91774b4ac83b6ead73e286dc8b8738269f0
parent2637742612ebe1870032e9e15c9f317cbbdb13cf (diff)
downloadmakefile_templates-a4d24e574d078dac6b2e3e9046406e24935019f0.tar.gz
makefile_templates-a4d24e574d078dac6b2e3e9046406e24935019f0.zip
improved destination handling
-rw-r--r--circuit_eps.mk8
-rw-r--r--eps.mk9
-rw-r--r--pic_pdf_compatible.mk11
-rw-r--r--pic_svg.mk8
4 files changed, 18 insertions, 18 deletions
diff --git a/circuit_eps.mk b/circuit_eps.mk
index 34b9e19..2c54a8a 100644
--- a/circuit_eps.mk
+++ b/circuit_eps.mk
@@ -3,12 +3,14 @@
CLEAN_TARGETS += clean_pdf_curcuit_targets
REAL_CLEAN_TARGETS += real_clean_pdf_curcuit_targets
+destination_dirs += $(pics_destdir)
+
curcuit_sourses = $(wildcard *.ps)
pdf_curcuit = $(curcuit_sourses:%.ps=$(pics_destdir)/%.pdf)
-copy_pdf_compatible_files: dest_dir_curcuit $(pdf_curcuit)
+copy_pdf_compatible_files: $(pdf_curcuit)
-$(pdf_curcuit): $(pics_destdir)/%.pdf : %.ps
+$(pdf_curcuit): $(pics_destdir)/%.pdf : %.ps | $(pics_destdir)
epstopdf --outfile=$@ $<
clean_pdf_curcuit_targets:
@@ -18,7 +20,5 @@ ifneq ($(strip $(pdf_curcuit)),)
rm -f $(pdf_curcuit)
endif
-dest_dir_curcuit:
- $(INSTALL) -d -m 0755 $(pics_destdir)
diff --git a/eps.mk b/eps.mk
index 8451f52..496f333 100644
--- a/eps.mk
+++ b/eps.mk
@@ -3,13 +3,15 @@
CLEAN_TARGETS += clean_eps_pdf_targets
REAL_CLEAN_TARGETS += real_clean_eps_pdf_targets
+destination_dirs += $(pics_destdir)
+
eps_sources = $(wildcard *.eps)
eps_pdf_targets = $(eps_sources:%.eps=$(pics_destdir)/%.pdf)
-copy_pdf_compatible_files: dest_dir_eps_pdf $(eps_pdf_targets)
+copy_pdf_compatible_files: $(eps_pdf_targets)
-$(eps_pdf_targets): $(pics_destdir)/%.pdf : %.eps
+$(eps_pdf_targets): $(pics_destdir)/%.pdf : %.eps | $(pics_destdir)
epstopdf --autorotate=All --outfile='$@' '$<'
clean_eps_pdf_targets:
@@ -19,7 +21,4 @@ ifneq ($(strip $(eps_pdf_targets)),)
rm -f $(eps_pdf_targets)
endif
-dest_dir_eps_pdf:
- $(INSTALL) -d -m 0755 $(pics_destdir)
-
.INTERMEDIATE:
diff --git a/pic_pdf_compatible.mk b/pic_pdf_compatible.mk
index 259b567..6bd29ff 100644
--- a/pic_pdf_compatible.mk
+++ b/pic_pdf_compatible.mk
@@ -3,6 +3,8 @@
CLEAN_TARGETS += clean_pdf_compatible
REAL_CLEAN_TARGETS += real_clean_pdf_compatible
+destination_dirs += $(pics_destdir)
+
pdf_compatible_files = \
$(wildcard *.pdf) \
$(wildcard *.png) \
@@ -10,9 +12,11 @@ pdf_compatible_files = \
copied_pdf_compatible_files = $(pdf_compatible_files:%=$(pics_destdir)/%)
-copy_pdf_compatible_files: dest_dir_pdf_compatible $(copied_pdf_compatible_files)
+.PHONY: clean_pdf_compatible real_clean_pdf_compatible
+
+copy_pdf_compatible_files: $(copied_pdf_compatible_files)
-$(copied_pdf_compatible_files): $(pics_destdir)/% : %
+$(copied_pdf_compatible_files): $(pics_destdir)/% : % | $(pics_destdir)
$(INSTALL) -m 0644 $< $@
clean_pdf_compatible:
@@ -22,6 +26,3 @@ ifneq ($(strip $(copied_pdf_compatible_files)),)
rm -f $(copied_pdf_compatible_files)
endif
-dest_dir_pdf_compatible:
- $(INSTALL) -d -m 0755 $(pics_destdir)
-
diff --git a/pic_svg.mk b/pic_svg.mk
index cfb5053..f14d37d 100644
--- a/pic_svg.mk
+++ b/pic_svg.mk
@@ -3,12 +3,14 @@
CLEAN_TARGETS += clean_pdf_svg_targets
REAL_CLEAN_TARGETS += real_clean_pdf_svg_targets
+destination_dirs += $(pics_destdir)
+
svg_sources = $(wildcard *.svg)
pdf_svg = $(svg_sources:%.svg=$(pics_destdir)/%.pdf)
-copy_pdf_compatible_files: dest_dir_svg $(pdf_svg)
+copy_pdf_compatible_files: $(pdf_svg)
-$(pdf_svg): $(pics_destdir)/%.pdf : %.svg
+$(pdf_svg): $(pics_destdir)/%.pdf : %.svg | $(pics_destdir)
inkscape --export-pdf=$@ $<
clean_pdf_svg_targets:
@@ -18,6 +20,4 @@ ifneq ($(strip $(pdf_svg)),)
rm -f $(pdf_svg)
endif
-dest_dir_svg:
- $(INSTALL) -d -m 0755 $(pics_destdir)