
# Regular spline library

# Optimization and Debug flags

PREF_CCFLAGS 	+= $(CCOPTFLAG) ;		# Turn optimisation on
#PREF_CCFLAGS	+= $(CCDEBUGFLAG) ;		# Debugging flags
#PREF_CCFLAGS 	+= $(CCPROFFLAG) ;		# Profile flags
#PREF_LINKFLAGS	+= $(LINKPROFFLAG) ;    # Profile flags
#PREF_CCFLAGS		+= $(CCHEAPDEBUG) ;		# Heap Debugging flags
PREF_LINKFLAGS	+= $(LINKDEBUGFLAG) ;      # Link with debug info

SCAT = scat ;	# Use thps scattered interpolation library

#Products
Libraries = librspl ;
Headers = rspl.h ;

#Install
#InstallLib  $(DESTDIR)$(PREFIX)/lib : $(Libraries) ;
#InstallFile $(DESTDIR)$(PREFIX)/h : $(Headers) ;

# Multi-dimensional regular spline library
Library librspl : rspl.c $(SCAT).c rev.c gam.c spline.c opt.c : : : ../h ../numlib ../plot ;

HDRS = ../h ../numlib ../plot $(TIFFINC) ;
LINKLIBS = librspl ../numlib/libnum ../plot/libplot ../plot/libvrml ../icc/libicc $(TIFFLIB) $(JPEGLIB) ;

# Test programs
MainsFromSources revbench.c c1.c c1df.c t2d.c t2ddf.c t3d.c t3ddf.c tnd.c trnd.c ;

BUILD_TESTS = true ;

if $(BUILD_TESTS) {

	HDRS = ../h ../numlib ../plot ../icc ../rspl ../xicc ../gamut ../cgats ../spectro $(TIFFINC) ;
	LINKLIBS = ../xicc/libxicc ../gamut/libgamut ../spectro/libinsttypes librspl
	           ../cgats/libcgats ../icc/libicc ../plot/libplot ../plot/libvrml
	           ../numlib/libnum $(TIFFLIB) $(JPEGLIB) ;

	# Smoothness factor tuning test in Nd.
	Main smtnd : smtnd.c ;

	# Smoothness factor tuning test in Nd.
	Main smtmpp : smtmpp.c ;

#	Main rand_check : rand_check.c ;

#	Main tt : tt.c ;

	HDRS = ;
	LINKLIBS = ;

	Main sm1 : sm1.c ;
	Main sm2 : sm2.c ;
	Main sm3 : sm3.c ;

}


#	Main tt : tt.c : : ../xicc : : : ../plot/libvrml ../icc/libicc ;

if $(BUILD_JUNK) {

	HDRS = ../h ../numlib ;
	LINKLIBS = ..//numlib/libnum ;

	#Main temp : temp.c ;

	MainsFromSources prime.c combo.c combo2.c combo3.c combo4.c combo5.c combo9.c ; 

	#Main cache : cache.c ;

	# Nearest point test code
	Main nptest : nptest.c ;

	# Nearest object test code
	Main notest : notest.c ;

	#direct mlbs scattered interpolation test
	Main mlbs_test : mlbs_test.c ;
}

