# -*- Makefile -*- 

# MACHINE AVAILABLE
#USE_HOME=USE_HOME
#USE_LAPTOP=USE_LAPTOP 
USE_WORK_64=USE_WORK_64
#USE_WORK_64_OLD=USE_WORK_64_OLD
#USE_WORK_32=USE_WORK_32
#USE_WULF=USE_WULF
#USE_WULF_32=USE_WULF_32

# LIBRARIES SUPPORTED
#USE_TZ = USE_TZ
USE_DW = USE_DW
  USE_DW_MATRIX = USE_DW_MATRIX
  USE_DW_ERROR = USE_DW_ERROR
  USE_DW_ARRAY = USE_DW_ARRAY
  USE_DW_ASCII = USE_DW_ASCII
  USE_DW_STAT = USE_DW_STAT
#  USE_DW_SORT = USE_DW_SORT
#  USE_DW_ELLIPTICAL = USE_DW_ELLIPTICAL
#  USE_DW_HISTO = USE_DW_HISTO
  USE_DW_MATH = USE_DW_MATH
#  USE_DW_SWITCH = USE_DW_SWITCH
#  USE_DW_STATE_SPACE = USE_DW_STATE_SPACE
USE_MKL = USE_MKL
#USE_ATLAS = USE_ATLAS
#USE_IMSL = USE_IMSL
USE_LAPACK = USE_LAPACK
#USE_FORTRAN = USE_FORTRAN
USE_MATH = USE_MATH
USE_GSL = USE_GLS
#USE_GSL_CBLAS = USE_GSL_CBLAS

#BASE_DIR = /mnt/dlink/git
#OUT_DIR = $(HOME)/work
BASE_DIR = $(HOME)/git
OUT_DIR = $(BASE_DIR)/utilities_dw/test_routines/matrix_test/c++

# .c files are compiled with gcc
CC = g++

MAKEFILE_DIR = $(OUT_DIR)

include $(MAKEFILE_DIR)/make_machines_master
include $(MAKEFILE_DIR)/make_libraries_master


#################################################################################

# DW FILES

# TZ FILES

# PROJECT FILE
INCLUDE_DIR := $(INCLUDE_DIR) -I$(OUT_DIR)
VPATH := $(VPATH) $(OUT_DIR)
OBJS := $(OBJS) matrix_test_main.o matrix_test.o matrix_test_instances.o

# OUTPUT
EFILE = $(OUT_DIR)/matrix_test


#################################################################################
$(EFILE): $(OBJS)
	$(CC) $(CFLAGS) $^ $(LIBS_DIR) $(LIBS) -o $(EFILE)

%.o : %.c
	gcc $(CFLAGS) $(INCLUDE_DIR) -c $< -o $(OUT_DIR)/$@

%.o : %.cpp
	$(CC) $(CFLAGS) $(INCLUDE_DIR) -c $< -o $(OUT_DIR)/$@

#################################################################################
clean:
	rm -f $(OUT_DIR)/*.o
#
#################################################################################
test:
	echo "OUT_DIR: $(OUT_DIR)"
	echo "VPATH: $(VPATH)"
	echo "INCLUDE_DIR: $(INCLUDE_DIR)"
	echo "LIBS_DIR: $(LIBS_DIR)"
