From 581c7fb69305b7c1a4085a57898fed0a0b6ff6da Mon Sep 17 00:00:00 2001 From: kinoshita-eos Date: Thu, 18 Sep 2014 15:47:06 +0900 Subject: [PATCH] Add: for Loop of Small Tools new file: TIPS/LoopCommand/Makefile new file: TIPS/LoopCommand/Makefile.config --- TIPS/LoopCommand/Makefile | 31 +++++++++++++++++++++++++++++++ TIPS/LoopCommand/Makefile.config | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 TIPS/LoopCommand/Makefile create mode 100644 TIPS/LoopCommand/Makefile.config diff --git a/TIPS/LoopCommand/Makefile b/TIPS/LoopCommand/Makefile new file mode 100644 index 0000000..25cbdc9 --- /dev/null +++ b/TIPS/LoopCommand/Makefile @@ -0,0 +1,31 @@ +# +# This is Main Makefile for loop of small tools.(Sample) +# + + +#### Input extention #### + +#### Suffixes rule #### +# Defined at Sub + +#### INCLUDE #### +-include Makefile.config + +#### Definition #### +## For define varioable +CALC_SCALE=15.6 + +#### Rules of the list created #### + +##### Commands ##### +all:: + EXE_COMMAND=anglediffchk \ + FIXED_OPTION="-r 90" \ + VARIABLE_OPTION="-t $(CALC_S) $(VAR) / 7 $(CALC_E) " \ + VARIABLE_OPTION=$(CALC_VAR) \ + LOOP_MIN=0 \ + LOOP_MAX=10 \ + LOOP_DELTA=1 \ + make LoopCommand; + +##### Commands(Input to Output) ##### diff --git a/TIPS/LoopCommand/Makefile.config b/TIPS/LoopCommand/Makefile.config new file mode 100644 index 0000000..4057c3b --- /dev/null +++ b/TIPS/LoopCommand/Makefile.config @@ -0,0 +1,40 @@ +# +# This is Sub Makefile for loop of small tools.(for include) +# + + +#### Input extention #### + +#### Suffixes rule #### +# Defined at Main + +#### INCLUDE #### + +#### Definition #### +### Define the following essential data at Main Makefile. +# EXE_COMMAND: Loop Command Name (e.g. mrcImageNoiseAdd) +# FIXED_OPTION: No Change Option (e.g. "-i Input.mrc -SD 1") +# VARIABLE_OPTION: Change Option by Loop (e.g. "-NS $(VAR) -SD $(CALC_S)$(VAR) / 7 $(CALC_E)") +# CALC_SCALE: Calculation Scale (e.g. 15.6) +# LOOP_MIN: LoopMinValue +# LOOP_MAX: LoopMaxValue +# LOOP_DELTA: LoopDeltaValue + +## For SubMakefile +VAR=LoopNumber +CALC_S=CalculationStart +CALC_E=CalculationEnd + +#### Rules of the list created #### +CALC_VAR=$$(echo $$VARIABLE_OPTION | sed s/$(VAR)/'$$$$loopnum'/g | sed s/$(CALC_S)/'$$$$(echo "scale=$(CALC_SCALE);'/g | sed s/$(CALC_E)/'" | bc)'/g) + +##### Commands ##### +LoopCommand:: + @for (( loopnum = $(LOOP_MIN); loopnum <= $(LOOP_MAX); loopnum += $(LOOP_DELTA) )) \ + do \ + echo "Loop: $$loopnum ($(EXE_COMMAND))"; \ + $(EXE_COMMAND) $(FIXED_OPTION) $(VARIABLE_OPTION); \ + done; + +##### Commands(Input to Output) ##### + -- 2.11.0