# Project: grid_analysis
# Linux GCC Makefile
# Created by O. Conrad

PRJ_NAME = grid_analysis
SAGA     = ./../../..
BIN_SAGA = $(SAGA)/../bin/saga_gtk
TMP_SAGA = $(SAGA)/../bin/tmp/saga_gtk
INC_SAGA = $(SAGA)/saga_core
MLB_TEMP = $(TMP_SAGA)/$(PRJ_NAME)
MLB_PATH = $(BIN_SAGA)/modules
MLB_NAME = $(MLB_PATH)/$(PRJ_NAME).so

CPP      = g++
LD       = g++

DEP_INCS = 
DEP_DEFS = 
DEP_LIBS = 
DEP_LFLG = 

OBJ      = $(MLB_TEMP)/Cost_Anisotropic.o $(MLB_TEMP)/Cost_Isotropic.o $(MLB_TEMP)/Cost_PolarToRect.o $(MLB_TEMP)/Cost_RectToPolar.o $(MLB_TEMP)/CoveredDistance.o $(MLB_TEMP)/CrossClassification.o $(MLB_TEMP)/Fuzzify.o $(MLB_TEMP)/FuzzyAND.o $(MLB_TEMP)/FuzzyOR.o $(MLB_TEMP)/Grid_AggregationIndex.o $(MLB_TEMP)/Grid_AHP.o $(MLB_TEMP)/Grid_CVA.o $(MLB_TEMP)/Grid_LayerOfMaximumValue.o $(MLB_TEMP)/Grid_Pattern.o $(MLB_TEMP)/Image_VI_Distance.o $(MLB_TEMP)/Image_VI_Slope.o $(MLB_TEMP)/LeastCostPathProfile.o $(MLB_TEMP)/MLB_Interface.o $(MLB_TEMP)/owa.o $(MLB_TEMP)/PointsEx.o $(MLB_TEMP)/Soil_Texture.o

DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
CXX_INCS =
CXX_DEFS =
CXX_FLGS = -O2
CXXFLAGS = $(CXX_INCS) $(CXX_DEFS) $(CXX_FLGS) $(DEP_INCS) $(DEP_DEFS) -I$(INC_SAGA) $(DEF_SAGA)

LDFLAGS  = -shared $(DEP_LFLG)
LIBS     = $(DEP_LIBS)

.PHONY: all all-before all-after clean clean-custom

all: all-before $(MLB_NAME) all-after

clean: clean-custom
	rm -f $(OBJ) $(MLB_NAME)

$(TMP_SAGA):
	-mkdir $(TMP_SAGA)

$(MLB_TEMP): $(TMP_SAGA)
	-mkdir $(MLB_TEMP)

$(MLB_PATH):
	-mkdir $(MLB_PATH)

$(MLB_NAME): $(MLB_TEMP) $(MLB_PATH) $(OBJ)
	$(LD) $(LDFLAGS) -o $(MLB_NAME) $(OBJ) $(LIBS)


$(MLB_TEMP)/Cost_Anisotropic.o: ./Cost_Anisotropic.cpp
	$(CPP) -c ./Cost_Anisotropic.cpp -o $(MLB_TEMP)/Cost_Anisotropic.o $(CXXFLAGS)

$(MLB_TEMP)/Cost_Isotropic.o: ./Cost_Isotropic.cpp
	$(CPP) -c ./Cost_Isotropic.cpp -o $(MLB_TEMP)/Cost_Isotropic.o $(CXXFLAGS)

$(MLB_TEMP)/Cost_PolarToRect.o: ./Cost_PolarToRect.cpp
	$(CPP) -c ./Cost_PolarToRect.cpp -o $(MLB_TEMP)/Cost_PolarToRect.o $(CXXFLAGS)

$(MLB_TEMP)/Cost_RectToPolar.o: ./Cost_RectToPolar.cpp
	$(CPP) -c ./Cost_RectToPolar.cpp -o $(MLB_TEMP)/Cost_RectToPolar.o $(CXXFLAGS)

$(MLB_TEMP)/CoveredDistance.o: ./CoveredDistance.cpp
	$(CPP) -c ./CoveredDistance.cpp -o $(MLB_TEMP)/CoveredDistance.o $(CXXFLAGS)

$(MLB_TEMP)/CrossClassification.o: ./CrossClassification.cpp
	$(CPP) -c ./CrossClassification.cpp -o $(MLB_TEMP)/CrossClassification.o $(CXXFLAGS)

$(MLB_TEMP)/Fuzzify.o: ./Fuzzify.cpp
	$(CPP) -c ./Fuzzify.cpp -o $(MLB_TEMP)/Fuzzify.o $(CXXFLAGS)

$(MLB_TEMP)/FuzzyAND.o: ./FuzzyAND.cpp
	$(CPP) -c ./FuzzyAND.cpp -o $(MLB_TEMP)/FuzzyAND.o $(CXXFLAGS)

$(MLB_TEMP)/FuzzyOR.o: ./FuzzyOR.cpp
	$(CPP) -c ./FuzzyOR.cpp -o $(MLB_TEMP)/FuzzyOR.o $(CXXFLAGS)

$(MLB_TEMP)/Grid_AggregationIndex.o: ./Grid_AggregationIndex.cpp
	$(CPP) -c ./Grid_AggregationIndex.cpp -o $(MLB_TEMP)/Grid_AggregationIndex.o $(CXXFLAGS)

$(MLB_TEMP)/Grid_AHP.o: ./Grid_AHP.cpp
	$(CPP) -c ./Grid_AHP.cpp -o $(MLB_TEMP)/Grid_AHP.o $(CXXFLAGS)

$(MLB_TEMP)/Grid_CVA.o: ./Grid_CVA.cpp
	$(CPP) -c ./Grid_CVA.cpp -o $(MLB_TEMP)/Grid_CVA.o $(CXXFLAGS)

$(MLB_TEMP)/Grid_LayerOfMaximumValue.o: ./Grid_LayerOfMaximumValue.cpp
	$(CPP) -c ./Grid_LayerOfMaximumValue.cpp -o $(MLB_TEMP)/Grid_LayerOfMaximumValue.o $(CXXFLAGS)

$(MLB_TEMP)/Grid_Pattern.o: ./Grid_Pattern.cpp
	$(CPP) -c ./Grid_Pattern.cpp -o $(MLB_TEMP)/Grid_Pattern.o $(CXXFLAGS)

$(MLB_TEMP)/Image_VI_Distance.o: ./Image_VI_Distance.cpp
	$(CPP) -c ./Image_VI_Distance.cpp -o $(MLB_TEMP)/Image_VI_Distance.o $(CXXFLAGS)

$(MLB_TEMP)/Image_VI_Slope.o: ./Image_VI_Slope.cpp
	$(CPP) -c ./Image_VI_Slope.cpp -o $(MLB_TEMP)/Image_VI_Slope.o $(CXXFLAGS)

$(MLB_TEMP)/LeastCostPathProfile.o: ./LeastCostPathProfile.cpp
	$(CPP) -c ./LeastCostPathProfile.cpp -o $(MLB_TEMP)/LeastCostPathProfile.o $(CXXFLAGS)

$(MLB_TEMP)/MLB_Interface.o: ./MLB_Interface.cpp
	$(CPP) -c ./MLB_Interface.cpp -o $(MLB_TEMP)/MLB_Interface.o $(CXXFLAGS)

$(MLB_TEMP)/owa.o: ./owa.cpp
	$(CPP) -c ./owa.cpp -o $(MLB_TEMP)/owa.o $(CXXFLAGS)

$(MLB_TEMP)/PointsEx.o: ./PointsEx.cpp
	$(CPP) -c ./PointsEx.cpp -o $(MLB_TEMP)/PointsEx.o $(CXXFLAGS)

$(MLB_TEMP)/Soil_Texture.o: ./Soil_Texture.cpp
	$(CPP) -c ./Soil_Texture.cpp -o $(MLB_TEMP)/Soil_Texture.o $(CXXFLAGS)
