#
# What you have to check...
#

# Packages you want to use
PACKAGES = datasets  distributions gradients kernels  matrix nonparametrics convolutions

# with images (and opencv)
#PACKAGES_LIB  =   bayes_image image_processing bayes_filter
#with images
PACKAGES_LIB  =  bayes_filter
MYPACKAGES := $(PACKAGES_LIB)


# Magik key if you have several makefile
# for the same platform
MAGIK_KEY = 

# Compiler, linker and archiver
CC = g++
LD = g++
AR = ar -rus

# Command for creating dependencies
DEP = g++ -MM

# Your librairies
# (for example "-lm", but not needed on most systems...)
# all these file are in the same place as the torch lib
MYLIBS += $(foreach f,$(PACKAGES_LIB),-l$f)

# for opencv : not needed if I don't want to use images
# MYLIBS += -lopencv -lhighgui -lm
MYLIBS += -lm 


# Your includes
# (for example -I/usr/local/special)
MYINCS += $(foreach f,$(PACKAGES_LIB),-I$(TORCHDIR)/$(f))


# optimize mode
DEBUG = OPT
# debug mode
#DEBUG = DBG

# double version
#FLOATING = DOUBLE
# floating version
FLOATING = FLOAT

# Debug double mode
CFLAGS_DBG_DOUBLE = -g -Wall -DUSE_DOUBLE -DDEBUG

# Debug float mode
CFLAGS_DBG_FLOAT = -g -Wall -DDEBUG

# Optimized double mode
CFLAGS_OPT_DOUBLE = -Wall -O2 -ffast-math -mcpu=i686 -march=i686 -malign-double -DUSE_DOUBLE

# Optimized float mode
CFLAGS_OPT_FLOAT = -Wall -O2 -ffast-math -mcpu=i686 -march=i686 -malign-double

#
#
# Variables that you may find useful inside your Makefile
# Do not touch.
#
#

MODE = $(DEBUG)_$(FLOATING)
VERSION_KEY = $(MAGIK_KEY)$(OS)_$(MODE)
LIBS_DIR = $(TORCHDIR)/lib/$(VERSION_KEY)
OBJS_DIR = $(TORCHDIR)/objs/$(VERSION_KEY)
LIBTORCH = $(LIBS_DIR)/libtorch.a
LIBS = -L$(TORCHDIR)/lib/$(VERSION_KEY)  $(MYLIBS) -ltorch
INCS := -I$(TORCHDIR)/core $(MYINCS)
INCS += $(foreach f,$(PACKAGES),-I$(TORCHDIR)/$(f))
