OSDN Git Service

Add: for Loop of Small Tools v2.0.2p0023
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 18 Sep 2014 06:47:06 +0000 (15:47 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 18 Sep 2014 06:47:06 +0000 (15:47 +0900)
new file:   TIPS/LoopCommand/Makefile
new file:   TIPS/LoopCommand/Makefile.config

TIPS/LoopCommand/Makefile [new file with mode: 0644]
TIPS/LoopCommand/Makefile.config [new file with mode: 0644]

diff --git a/TIPS/LoopCommand/Makefile b/TIPS/LoopCommand/Makefile
new file mode 100644 (file)
index 0000000..25cbdc9
--- /dev/null
@@ -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 (file)
index 0000000..4057c3b
--- /dev/null
@@ -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) #####
+