# Copyright 2009, 2010 IPOL Image Processing On Line http://www.ipol.im/
# Author: Nicolas Limare <nicolas.limare@cmla.ens-cachan.fr>
#
# Copying and distribution of this file, with or without
# modification, are permitted in any medium without royalty provided
# the copyright notice and this notice are preserved.  This file is
# offered as-is, without any warranty.

#VARIABLE VALUE EXAMPLES
#CXX=C:\MINGW\BIN\g++.exe
#OMPF=-fopenmp
#OMPD=-DAMI_OMP_H
#ARCH=-march=i586


LIBS=libs/Wlibs
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
  LIBS=libs/Ulibs64
endif
ifeq ($(LBITS),32)
  LIBS=libs/Ulibs32
endif
lens_distortion_estimation:  ami_pol.o lens_distortion.o lens_distortion_estimation.o ami_bmp.o
	$(CXX) $(OMPF) $(OMPD) $(ARCH) -o lens_distortion_estimation ami_pol.o lens_distortion.o lens_distortion_estimation.o ami_bmp.o -L$(LIBS) -litkjpeg8 -litkpng -litktiff -lopenjpeg -litkzlib

lens_distortion_estimation.o:  lens_distortion_estimation.cpp
	$(CXX) $(OMPF) $(OMPD) $(ARCH) -c lens_distortion_estimation.cpp -Iimage
	
ami_pol.o:  ami_pol.c
	$(CXX) $(OMPF) $(OMPD) $(ARCH) -c ami_pol.c

ami_bmp.o:  image/ami_bmp/ami_bmp.cpp
	$(CXX) $(OMPF) $(OMPD) $(ARCH) -c image/ami_bmp/ami_bmp.cpp 
	
lens_distortion.o:  lens_distortion.cpp
	$(CXX) $(OMPF) $(OMPD) $(ARCH) -c lens_distortion.cpp -Iimage
	

	