gnu make - Echo command in makefile not printing -


i have following makefile, rule checks dependencies:

#!/usr/bin/make -f  dependencies:     $(info start-info)     @echo "start-echo"     $(call assert-command-present,fastqc)     $(call assert-command-present,cutadapt)     $(call assert-command-present,bowtie2)     $(call assert-command-present,samtools)     $(call assert-command-present,bedtools)     $(call assert-command-present,fetchchromsizes)     $(call assert-command-present,bedgraphtobigwig)     $(info end-info)     @echo "end-echo"  pipeline: dependencies  assert-command-present = $(info checking $1) && $(if $(shell $1),$(info ok.),$(error error: not find '$1'. exiting)) 

the user-defined function assert-command-present checks command in path, , returns error if not found. when run makefile, echo , info commands not returned in order expect:

start-info checking fastqc ok. checking cutadapt ok. checking bowtie2 ok. checking samtools ok. checking bedtools ok. checking fetchchromsizes ok. checking bedgraphtobigwig ok. end-info start-echo end-echo 

the start-echo , start-info commands should run before assert-command-presents functions run, echo command runs after function calls.

eugeniu rosca correct. more generally, "make" built-in functions evaluated first, entire command sequence run.

one way see use gnu make debugger remake. can stop @ target "dependencies", , write out commands run in shell.

for example:

 $ remake -x -f /tmp/makefile dependencies  gnu make 4.1+dbg0.91  ...  updating goal targets....  -> (/tmp/makefile:3)  dependencies:   remake<0> write  start-info  end-info  file "/tmp/dependencies.sh" written.  remake<1>  

look @ file /tmp/dependencies.sh , see of make functions removed or expanded whatever value returned in case empty lines.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -