summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2014-01-15 22:36:43 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2014-01-15 22:36:43 -0500
commit350a7f035e93df88a2472e953e82d05ad5753ae1 (patch)
treeff12a316e6899c2d31b2dfa0a9badb75bfeb4248
parentc5b79fc8b83f298da56e2f24b830babc1ce2e514 (diff)
downloadmakefile_templates-350a7f035e93df88a2472e953e82d05ad5753ae1.tar.gz
makefile_templates-350a7f035e93df88a2472e953e82d05ad5753ae1.zip
gnuplot helper make file
-rw-r--r--gnuplot_eps.mk38
-rw-r--r--pic_source_dir/Makefile1
-rw-r--r--pic_source_subdir/Makefile1
3 files changed, 40 insertions, 0 deletions
diff --git a/gnuplot_eps.mk b/gnuplot_eps.mk
new file mode 100644
index 0000000..aa7730a
--- /dev/null
+++ b/gnuplot_eps.mk
@@ -0,0 +1,38 @@
+# -*- make -*-
+
+CLEAN_TARGETS += clean_gnuplot_eps_targets
+REAL_CLEAN_TARGETS += real_clean_gnuplot_eps_targets
+
+gnuplot_sources = $(wildcard *.gp)
+gnuplot_eps_targets = $(gnuplot_sources:%.gp=%.eps)
+gnuplot_pdf_targets = $(gnuplot_eps_targets:%.eps=$(pics_destdir)/%.pdf)
+
+
+copy_gnuplot_pdf_targets: dest_dir_gnuplot $(gnuplot_pdf_targets)
+
+$(gnuplot_eps_targets): %.eps : %.gp
+ echo "set output '$@'" \
+ | cat - \
+ $(GNUPLOT_TEMPLATES_DIR)/terminal_eps_settings.gp_tmplt \
+ $(GNUPLOT_TEMPLATES_DIR)/lines_specifications.gp_tmplt \
+ $< \
+ | gnuplot
+ rm -f fit.log
+
+$(gnuplot_pdf_targets): $(pics_destdir)/%.pdf : %.eps
+ epstopdf --autorotate=All --outfile=$@ $<
+
+clean_gnuplot_eps_targets:
+ rm -f fit.log
+ifneq ($(strip $(gnuplot_eps_targets)),)
+ rm -f $(gnuplot_eps_targets)
+endif
+
+real_clean_gnuplot_eps_targets: clean_gnuplot_eps_targets
+ifneq ($(strip $(gnuplot_pdf_targets)),)
+ rm -f $(gnuplot_pdf_targets)
+endif
+
+dest_dir_gnuplot:
+ $(INSTALL) -d -m 0755 $(pics_destdir)
+
diff --git a/pic_source_dir/Makefile b/pic_source_dir/Makefile
index 8832758..c229146 100644
--- a/pic_source_dir/Makefile
+++ b/pic_source_dir/Makefile
@@ -7,6 +7,7 @@ include ./local.mk
include $(TOPDIR)/common.mk
include $(MAKEINCLUDE_DIR)/pic_pdf_compatible.mk
include $(MAKEINCLUDE_DIR)/pic_svg.mk
+include $(MAKEINCLUDE_DIR)/gnuplot_eps.mk
include $(MAKEINCLUDE_DIR)/subdirs.mk
dest_dir = $(DESTDIR)$(PREFIX)/$(PACKAGE_DIR)
diff --git a/pic_source_subdir/Makefile b/pic_source_subdir/Makefile
index aa08d03..ad3612d 100644
--- a/pic_source_subdir/Makefile
+++ b/pic_source_subdir/Makefile
@@ -7,6 +7,7 @@ include ./local.mk
include $(TOPDIR)/common.mk
include $(MAKEINCLUDE_DIR)/pic_pdf_compatible.mk
include $(MAKEINCLUDE_DIR)/pic_svg.mk
+include $(MAKEINCLUDE_DIR)/gnuplot_eps.mk
include $(MAKEINCLUDE_DIR)/subdirs.mk
dest_dir = $(DESTDIR)$(PREFIX)/$(PACKAGE_DIR)