summaryrefslogtreecommitdiff
path: root/gnuplot_eps.mk
blob: af9b41107bd48dc4659cbc4086fa67630d35264f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- 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)

.INTERMEDIATE: $(gnuplot_eps_targets)