I have a bash script which outputs calls to my make file.
#!/bin/bash mylist=( 'SAMPLES_OUT=$(call list_samples,AON_9,NT_1,SC_17) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me1.gff' 'SAMPLES_OUT=$(call list_samples,AON_10,NT_2,SC_18) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me2.gff' 'SAMPLES_OUT=$(call list_samples,AON_11,NT_3,SC_19) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me3.gff' 'SAMPLES_OUT=$(call list_samples,AON_12,NT_4,SC_20) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me4.gff' 'SAMPLES_OUT=$(call list_samples,AON_13,NT_5,SC_21) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me5.gff' ) for SAMPLES_out in "${mylist[@]}"; do make -f make_gene_read_count.mk -n SAMPLES_OUT=\'${SAMPLES_out}\' done This is the makefile:
IN_DIR = /data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/namesorted_bams list_samples = $(shell ls $(IN_DIR)/*$(1)* $(IN_DIR)/*$(2)* $(IN_DIR)/*$(3)* | sed 's/\.namesorted\.bam/\.gene\.read\.count/g') #SAMPLES_OUT := $(call list_samples,AON_9,NT_1,SC_17) all: $(SAMPLES_OUT) GFF := /data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me1.gff GFF_TEMP := $(GFF).temp.gff $(GFF_TEMP): $(GFF) sed 's/\*/./g' $< > $@ %.gene.read.count: %.namesorted.bam $(GFF_TEMP) htseq-count -t exon -m intersection-strict -f bam -r name -s no $^ > $@ I am trying to pass 2 variables out of the same array to my makefile but this does not seem to work properly as well if I do it like this in my bash scripts array list:
'$(call list_samples,AON_9,NT_1,SC_17) GFF=/data/DIV5/SASC/project-013-motor/analysis/runs/BWA_chipcap/BAMS/GFF/H3K4me1.gff' Unfortunately it seems that makefile cannot deal with this kind of constructs. How can i pass both variables to my makefile without any command line problems. So how to circumvent $(call) been seen as a command line call. The 2 variables i want to pass to the makefile are GFF and SAMPLES_OUT.