INCLUDE=-I ./
BIN=../bin
LIB=-L ./ -lmatrixSHEN -lm

all : LinuxCalculateJacobian LinuxCutDeformationField LinuxCutPTS LinuxDeformationFieldOffsetAbsoluteShift LinuxGetSmallImageSize LinuxImageTransformation LinuxInverseWaveletPacketTransformOfDeformation LinuxInverseWaveletPacketTransformOfImage LinuxNewImageGlobalTransformation LinuxPCAImageWPTsSimulate LinuxPCAWPTsSimulate LinuxPCAofImageWPTs LinuxRecoverDeformationField LinuxResaveDeformationField LinuxResaveJacobian LinuxResizeImage LinuxSmoothDeformationField LinuxWaveletPacketTransformOfDeformation LinuxWaveletPacketTransformOfImage

LinuxCalculateJacobian : calculate_jacobian.c
	gcc -c calculate_jacobian.c ${INCLUDE} -O2
	gcc -o LinuxCalculateJacobian calculate_jacobian.o ${LIB}

LinuxCutDeformationField : cut_deformationfield.c
	gcc -c cut_deformationfield.c ${INCLUDE} -O2
	gcc -o LinuxCutDeformationField cut_deformationfield.o ${LIB}

LinuxCutPTS : cut_pts.c
	gcc -c cut_pts.c ${INCLUDE} -O2
	gcc -o LinuxCutPTS cut_pts.o ${LIB}

LinuxDeformationFieldOffsetAbsoluteShift : deformationfield_offset_absolute_shift.c
	gcc -c deformationfield_offset_absolute_shift.c ${INCLUDE} -O2
	gcc -o LinuxDeformationFieldOffsetAbsoluteShift deformationfield_offset_absolute_shift.o ${LIB}

LinuxGetSmallImageSize : get_small_imagesize.c
	gcc -c get_small_imagesize.c ${INCLUDE} -O2
	gcc -o LinuxGetSmallImageSize get_small_imagesize.o ${LIB}

LinuxImageTransformation : image_transformation.c
	gcc -c image_transformation.c ${INCLUDE} -O2
	gcc -o LinuxImageTransformation image_transformation.o ${LIB}

LinuxInverseWaveletPacketTransformOfDeformation : inverse_wavelet_packet_transform_of_deformation.c
	gcc -c inverse_wavelet_packet_transform_of_deformation.c ${INCLUDE} -O2
	gcc -o LinuxInverseWaveletPacketTransformOfDeformation inverse_wavelet_packet_transform_of_deformation.o ${LIB}

LinuxInverseWaveletPacketTransformOfImage : inverse_wavelet_packet_transform_of_image.c
	gcc -c inverse_wavelet_packet_transform_of_image.c ${INCLUDE} -O2
	gcc -o LinuxInverseWaveletPacketTransformOfImage inverse_wavelet_packet_transform_of_image.o ${LIB}

LinuxNewImageGlobalTransformation : new_image_global_transformation.c 
	gcc -c new_image_global_transformation.c ${INCLUDE} -O2
	gcc -o LinuxNewImageGlobalTransformation new_image_global_transformation.o ${LIB}

LinuxPCAImageWPTsSimulate : pca_image_WPTs_simulate.c 
	gcc -c pca_image_WPTs_simulate.c  ${INCLUDE} -O2
	gcc -o LinuxPCAImageWPTsSimulate pca_image_WPTs_simulate.o ${LIB}

LinuxPCAWPTsSimulate : pca_WPTs_simulate.c 
	gcc -c pca_WPTs_simulate.c ${INCLUDE} -O2
	gcc -o LinuxPCAWPTsSimulate pca_WPTs_simulate.o ${LIB}

LinuxRecoverDeformationField : recover_deformationfield.c
	gcc -c recover_deformationfield.c ${INCLUDE} -O2
	gcc -o LinuxRecoverDeformationField recover_deformationfield.o ${LIB}

LinuxResaveDeformationField :  resave_deformationfield.c
	gcc -c  resave_deformationfield.c ${INCLUDE} -O2
	gcc -o LinuxResaveDeformationField resave_deformationfield.o ${LIB}

LinuxResaveJacobian : resave_jacobian.c
	gcc -c resave_jacobian.c ${INCLUDE} -O2
	gcc -o LinuxResaveJacobian resave_jacobian.o ${LIB}

LinuxResizeImage : resize_image.c
	gcc -c resize_image.c ${INCLUDE} -O2
	gcc -o LinuxResizeImage resize_image.o ${LIB}

LinuxSmoothDeformationField : smooth_deformationfield.c
	gcc -c smooth_deformationfield.c ${INCLUDE} -O2
	gcc -o LinuxSmoothDeformationField smooth_deformationfield.o ${LIB}

LinuxWaveletPacketTransformOfDeformation : wavelet_packet_transform_of_deformation.c
	gcc -c wavelet_packet_transform_of_deformation.c ${INCLUDE} -O2
	gcc -o LinuxWaveletPacketTransformOfDeformation wavelet_packet_transform_of_deformation.o ${LIB}

LinuxWaveletPacketTransformOfImage : wavelet_packet_transform_of_image.c
	gcc -c wavelet_packet_transform_of_image.c ${INCLUDE} -O2
	gcc -o LinuxWaveletPacketTransformOfImage wavelet_packet_transform_of_image.o ${LIB}

LinuxPCAofImageWPTs : pca_of_image_WPTs.c
	gcc -c pca_of_image_WPTs.c ${INCLUDE} -O2
	gcc -o LinuxPCAofImageWPTs pca_of_image_WPTs.o  ${LIB}

install :
	mv LinuxCalculateJacobian ${BIN}
	mv LinuxCutDeformationField  ${BIN}
	mv LinuxCutPTS  ${BIN}
	mv LinuxDeformationFieldOffsetAbsoluteShift  ${BIN}
	mv LinuxGetSmallImageSize  ${BIN}
	mv LinuxImageTransformation  ${BIN}
	mv LinuxInverseWaveletPacketTransformOfDeformation  ${BIN}
	mv LinuxInverseWaveletPacketTransformOfImage  ${BIN}
	mv LinuxNewImageGlobalTransformation  ${BIN}
	mv LinuxPCAImageWPTsSimulate  ${BIN}
	mv LinuxPCAWPTsSimulate  ${BIN}
	mv LinuxPCAofImageWPTs  ${BIN}
	mv LinuxRecoverDeformationField  ${BIN}
	mv LinuxResaveDeformationField ${BIN} 
	mv LinuxResaveJacobian  ${BIN}
	mv LinuxResizeImage ${BIN} 
	mv LinuxSmoothDeformationField ${BIN} 
	mv LinuxWaveletPacketTransformOfDeformation ${BIN} 
	mv LinuxWaveletPacketTransformOfImage ${BIN}

	echo "The Deformation Simulator package is installed successfully"

clean : 
	rm -rf *.o



