# -----------------------------------------------------------------
#   Makefile for GStream
#
#   
# --------------------------------------------------------------------

FORCE_DYNAMIC = 

# Set this variable to either UNIX or WIN
SYS = WIN

# Put C++ compiler here. It is platform specific. If you will not use MPI, it is not necessarily to define CXX_MPI.
CXX_UNIX = g++
CXX_WIN = C:\MinGW\bin\mingw32-g++.exe

# Define the place of BOOST header files on Windows
HITPP = C:\GStreamSRC\itpp-4.2
LITPP = C:\GStreamSRC\itpp-4.2\itpp\libs\libitpp.a
HARMA = C:\GStreamSRC\armadillo-3.2.4\include


# Any other compiler flags here
CXXFLAGS = 


# --------------------------------------------------------------------
# Do not edit below this line
# --------------------------------------------------------------------

CXXFLAGS += -O2 -Wall
OUTPUT = gstream

# Define some specific flags

ifeq ($(SYS),WIN)
 LIB = $(LITPP)
 CXXFLAGS += -DWIN
 CRM = del
 CXX = $(CXX_WIN)
 ifndef FORCE_DYNAMIC
  CXXFLAGS += -static
 endif
 CXXFLAGS += -I $(HITPP) -I $(HARMA)
endif

ifeq ($(SYS),UNIX)
 CXXFLAGS += -DUNIX
 CRM = rm -f
 CXX = $(CXX_UNIX)
 ifndef FORCE_DYNAMIC
  CXXFLAGS += -static
 endif
 CXXFLAGS += -litpp
endif


SRC = main.cpp options.cpp misc.cpp locus.cpp genotype.cpp cnvscoring.cpp
HDR = main.h options.h misc.h locus.h genotype.h cnvscoring.h individus.h
OBJ = $(SRC:.cpp=.o)

all : $(OUTPUT)

$(OUTPUT) :
	$(CXX) $(CXXFLAGS) -o $(OUTPUT) $(OBJ) $(LIB) 

$(OBJ) : $(HDR)

.cpp.o : 
	$(CXX) $(CXXFLAGS) -c $*.cpp
.SUFFIXES : .cpp .c .o $(SUFFIXES)

$(OUTPUT) : $(OBJ)

FORCE:

clean:
	$(CRM) *.o *~ gstream

