#
#	This is Sub Makefile for Create Sample Image that has grid points.
#

#### Input extention ####
# Defined at Main

#### Suffixes rule ####
.SUFFIXES: .$(NUL) .$(ONE) .$(GRID)

#### INCLUDE ####
-include ${EOS_HOME}/tutorial/TIPS/NulImage/Makefile/Makefile-lib

#### Definition ####
# Defined at Main

# For ../NulImage/Makefile.config
NUL_FILE_NAME=$(FILE_NAME)
NUL_SIZE_X=$(1SIZE_X)
NUL_SIZE_Y=$(1SIZE_Y)
NUL_SIZE_Z=$(1SIZE_Z)
NUL_VALUE=$(BACK_VALUE)
NUL_LENGTH=$(LENGTH)

#### Rules of the list created ####


##### Commands #####
1PointImage::
	make $(FILE_NAME).$(ONE);

GridImage::
	make $(FILE_NAME).$(GRID);
	
Grid2Tiff::
	mrc2tiff -i $(FILE_NAME).$(GRID) -o $(FILE_NAME).$(TIFF);

##### Commands(Input to Output) #####
ifdef NUL
ifdef ONE
.$(NUL).$(ONE):
	mrcImageScalarAdd -i $*.$(NUL) -o $*.$(ONE) -m 1 -v $(POINT_VALUE) \
						-x $(POINT_X) -y $(POINT_Y) -z $(POINT_Z);
endif #ONE
endif #NUL

ifdef ONE
ifdef GRID
.$(ONE).$(GRID):
	mrcImageCrystalCreate -i $*.$(ONE) -o $*.$(GRID) \
							-nx $(NUM_X) -ny $(NUM_Y) -nz $(NUM_Z);
endif #GRID
endif #ONE
