From c9b5f20812fae3bcbdf3ee194c06e7b9f574cc70 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 12 May 2017 08:43:15 -0700 Subject: [PATCH] add some makefile templates --- templates/makefiles/gene_information.mk | 6 ++++++ templates/makefiles/snp_information.mk | 9 +++++++++ templates/makefiles/sweave_rules.mk | 15 +++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 templates/makefiles/gene_information.mk create mode 100644 templates/makefiles/snp_information.mk create mode 100644 templates/makefiles/sweave_rules.mk diff --git a/templates/makefiles/gene_information.mk b/templates/makefiles/gene_information.mk new file mode 100644 index 0000000..086894e --- /dev/null +++ b/templates/makefiles/gene_information.mk @@ -0,0 +1,6 @@ +GENE_INFO ?=$(shell dir=./; while [ "$$( (cd $${dir} >/dev/null; pwd) )" != "/" ]; do if [ -e "$${dir}bin/gene_info" ]; then echo $${dir}bin/gene_info; break; fi; dir="$${dir}../"; done;) + +GENE_INFO_OPTIONS ?= --splicing + +gene_information.txt: gene_list.txt $(GENE_INFO) + $(GENE_INFO) $(GENE_INFO_OPTIONS) $< > $@; diff --git a/templates/makefiles/snp_information.mk b/templates/makefiles/snp_information.mk new file mode 100644 index 0000000..8a89c6b --- /dev/null +++ b/templates/makefiles/snp_information.mk @@ -0,0 +1,9 @@ +SNP_INFO ?=$(shell dir=./; while [ "$$( (cd $${dir} >/dev/null; pwd) )" != "/" ]; do if [ -e "$${dir}bin/snp_info" ]; then echo $${dir}bin/snp_info; break; fi; dir="$${dir}../"; done;) + +snp_information.txt: snp_list.txt + if [ -e $@.target.md5sum ] && [ -e $@ ] && md5sum --status --check $@.target.md5sum; then \ + touch $@; \ + else \ + $(SNP_INFO) $(SNP_INFO_OPTIONS) $< > $@; \ + md5sum $^ > $@.target.md5sum; \ + fi; diff --git a/templates/makefiles/sweave_rules.mk b/templates/makefiles/sweave_rules.mk new file mode 100644 index 0000000..32b1a44 --- /dev/null +++ b/templates/makefiles/sweave_rules.mk @@ -0,0 +1,15 @@ +R ?= R + +%.pdf: %.svg + inkscape -A $@ $< + pdfcrop $@ + mv $(dir $@)*-crop.pdf $@ + +%.png: %.svg + inkscape -e $@ -d 300 $< + +%.tex: %.Rnw + $(R) CMD Sweave --encoding=utf-8 $< + +%.pdf: %.tex $(wildcard *.bib) $(wildcard *.tex) + latexmk -pdflatex=xelatex -bibtex -use-make -pdf $< -- 2.39.2