# /*@@
#   @file    make.config.defn.in
#   @date    Sun Jan 17 22:33:51 1999
#   @author  Tom Goodale
#   @desc
#            Make definition file for a configuration
#            Defines the compilers, etc.
#
#            Should be run through autoconf to produce make.config.defn
#   @enddesc
#   @version $Header$
# @@*/

# Include stuff defined by optional extra arrangements
include $(TOP)/config-data/make.extra.defn

# Include all required external libraries from configuration
-include $(TOP)/bindings/Configuration/make.link


# Compiler/executable info
export SHELL       = @SHELL@
export MKDIR       = @MKDIR@
export CC          = @CC@
export CXX         = @CXX@
export CUCC        = @CUCC@
export F90         = @F90@
export F77         = @F77@
export CPP         = @CPP@
export FPP         = @FPP@
export LD          = @LD@
export AR          = @AR@
export RANLIB      = @RANLIB@
export PERL        = @PERL@
# MAKE needs no definition, since make will set this variable automatically
export MAKE
export TAR         = @TAR@
export XARGS       = @XARGS@
# GZIP is used by gzip for a list of default options, thus we use GZIP_CMD
export GZIP_CMD    = @GZIP_CMD@
export PATCH       = @PATCH@
export GIT         = @GIT@

export CFLAGS      = @CFLAGS@
export CXXFLAGS    = @CXXFLAGS@
export CUCCFLAGS   = @CUCCFLAGS@
export F90FLAGS    = @F90FLAGS@
export F77FLAGS    = @F77FLAGS@
export CPPFLAGS    = @CPPFLAGS@
export FPPFLAGS    = @FPPFLAGS@

export C_LINE_DIRECTIVES = @C_LINE_DIRECTIVES@
export F_LINE_DIRECTIVES = @F_LINE_DIRECTIVES@

# Compiler versions as detected at configure time
# CPP: @CPP_VERSION@
# CC:  @CC_VERSION@
# CXX: @CXX_VERSION@
# CUCC: @CUCC_VERSION@
# FPP: @FPP_VERSION@
# F77: @F77_VERSION@
# F90: @F90_VERSION@

export MKDIRFLAGS  = @MKDIRFLAGS@

export LDFLAGS     = @LDFLAGS@

export ARFLAGS     = @ARFLAGS@
export RANLIBFLAGS = @RANLIBFLAGS@
export LIBDIR_PREFIX = @LIBDIR_PREFIX@
export RUNDIR_PREFIX = @RUNDIR_PREFIX@
export LIBLINK_PREFIX = @LIBLINK_PREFIX@

# Debug flags
export CPP_DEBUG_FLAGS = @CPP_DEBUG_FLAGS@
export FPP_DEBUG_FLAGS = @FPP_DEBUG_FLAGS@
export C_DEBUG_FLAGS   = @C_DEBUG_FLAGS@
export CXX_DEBUG_FLAGS = @CXX_DEBUG_FLAGS@
export CUCC_DEBUG_FLAGS = @CUCC_DEBUG_FLAGS@
export F90_DEBUG_FLAGS = @F90_DEBUG_FLAGS@
export F77_DEBUG_FLAGS = @F77_DEBUG_FLAGS@

# Optimisation flags
export CPP_OPTIMISE_FLAGS = @CPP_OPTIMISE_FLAGS@
export FPP_OPTIMISE_FLAGS = @FPP_OPTIMISE_FLAGS@
export C_OPTIMISE_FLAGS   = @C_OPTIMISE_FLAGS@
export CXX_OPTIMISE_FLAGS = @CXX_OPTIMISE_FLAGS@
export CUCC_OPTIMISE_FLAGS = @CUCC_OPTIMISE_FLAGS@
export F90_OPTIMISE_FLAGS = @F90_OPTIMISE_FLAGS@
export F77_OPTIMISE_FLAGS = @F77_OPTIMISE_FLAGS@

# No-optimisation flags
export C_NO_OPTIMISE_FLAGS   = @C_NO_OPTIMISE_FLAGS@
export CXX_NO_OPTIMISE_FLAGS = @CXX_NO_OPTIMISE_FLAGS@
export CUCC_NO_OPTIMISE_FLAGS = @CUCC_NO_OPTIMISE_FLAGS@
export F90_NO_OPTIMISE_FLAGS = @F90_NO_OPTIMISE_FLAGS@
export F77_NO_OPTIMISE_FLAGS = @F77_NO_OPTIMISE_FLAGS@

# Profiling flags
export CPP_PROFILE_FLAGS = @CPP_PROFILE_FLAGS@
export FPP_PROFILE_FLAGS = @FPP_PROFILE_FLAGS@
export C_PROFILE_FLAGS   = @C_PROFILE_FLAGS@
export CXX_PROFILE_FLAGS = @CXX_PROFILE_FLAGS@
export CUCC_PROFILE_FLAGS = @CUCC_PROFILE_FLAGS@
export F90_PROFILE_FLAGS = @F90_PROFILE_FLAGS@
export F77_PROFILE_FLAGS = @F77_PROFILE_FLAGS@

# OpenMP flags
export CPP_OPENMP_FLAGS = @CPP_OPENMP_FLAGS@
export FPP_OPENMP_FLAGS = @FPP_OPENMP_FLAGS@
export C_OPENMP_FLAGS   = @C_OPENMP_FLAGS@
export CXX_OPENMP_FLAGS = @CXX_OPENMP_FLAGS@
export CUCC_OPENMP_FLAGS = @CUCC_OPENMP_FLAGS@
export F90_OPENMP_FLAGS = @F90_OPENMP_FLAGS@
export F77_OPENMP_FLAGS = @F77_OPENMP_FLAGS@

# Warning flags
export CPP_WARN_FLAGS = @CPP_WARN_FLAGS@
export FPP_WARN_FLAGS = @FPP_WARN_FLAGS@
export C_WARN_FLAGS   = @C_WARN_FLAGS@
export CXX_WARN_FLAGS = @CXX_WARN_FLAGS@
export CUCC_WARN_FLAGS = @CUCC_WARN_FLAGS@
export F90_WARN_FLAGS = @F90_WARN_FLAGS@
export F77_WARN_FLAGS = @F77_WARN_FLAGS@

# Most compilers use -c -o to compile only, some do something different
export CCOMPILEONLY = @CCOMPILEONLY@
export FCOMPILEONLY = @FCOMPILEONLY@

# Most compilers use -o for naming the executable, alas some don't
export CREATEEXE = @CREATEEXE@

# On Unix a /
export DIRSEP = @DIRSEP@

export EMPTY_VAR = # Nothing.  Leading space is removed.

# Mostly a single space, sometimes nothing at all
export OPTIONSEP = @OPTIONSEP@

# Some architectures need to do something special for linking in libraries
export LIBNAME_PREFIX = @LIBNAME_PREFIX@# Make sure there is no space at end.
export LIBNAME_SUFFIX = @LIBNAME_SUFFIX@

export BEGIN_WHOLE_ARCHIVE_FLAGS = @BEGIN_WHOLE_ARCHIVE_FLAGS@
export END_WHOLE_ARCHIVE_FLAGS   = @END_WHOLE_ARCHIVE_FLAGS@

export CACTUSLIBLINKLINE = @CACTUSLIBLINKLINE@

# Dependency file generation
export C_DEPEND             = @C_DEPEND@
export CXX_DEPEND           = @CXX_DEPEND@
export CL_DEPEND            = @CL_DEPEND@
export CUCC_DEPEND          = @CUCC_DEPEND@
export F77_DEPEND           = @F77_DEPEND@
export F_DEPEND             = @F_DEPEND@
export F_DEPEND_MODULES     = @F_DEPEND_MODULES@

export C_DEPEND_OUT         = @C_DEPEND_OUT@
export CXX_DEPEND_OUT       = @CXX_DEPEND_OUT@
export CL_DEPEND_OUT        = @CL_DEPEND_OUT@
export CUCC_DEPEND_OUT      = @CUCC_DEPEND_OUT@
export F77_DEPEND_OUT       = @F77_DEPEND_OUT@
export F_DEPEND_OUT         = @F_DEPEND_OUT@
export F_DEPEND_MODULES_OUT = @F_DEPEND_MODULES_OUT@

# Some compilers are very picky about the names of C++ files
export CXX_WORKING_NAME = @CXX_WORKING_NAME@

# Some compilers are very picky about the suffix for fortran files
export F90_SUFFIX = @F90_SUFFIX@

# How to postprocess object files
export C_POSTPROCESSING    = @C_POSTPROCESSING@
export CXX_POSTPROCESSING  = @CXX_POSTPROCESSING@
export CL_POSTPROCESSING   = @CL_POSTPROCESSING@
export CUCC_POSTPROCESSING = @CUCC_POSTPROCESSING@
export F77_POSTPROCESSING  = @F77_POSTPROCESSING@
export F_POSTPROCESSING    = @F_POSTPROCESSING@
export F90_POSTPROCESSING  = @F90_POSTPROCESSING@

# Do we need to use ranlib ?
export USE_RANLIB = @USE_RANLIB@

# Exclude some files from the dependency lists
export DEP_EXCLUDE_FILES = CParameterStructNames\.h

# Command used to get the working directory
export GET_WD = @GET_WD@

# Way for Make to transofrm things like include directories
# into a form suitable for the compiler.

export TRANSFORM_DIRS = @TRANSFORM_DIRS@

# Library info
export LIBS    += @LIBS@
export LIBDIRS += @LIBDIRS@

# Command to generate the link line for libraries
export GENERAL_LIBRARIES = @GENERAL_LIBRARIES@

# System include directories
export SYS_INC_DIRS += @SYS_INC_DIRS@

# Annoying stuff for some file systems.
export PERL_BACKUP_NECESSARY = @PERL_BACKUP_NECESSARY@

# Stuff for the architecture
export OS     = @host_os@
export CPU    = @host_cpu@
export VENDOR = @host_vendor@

# X stuff
export X_LIB_DIR  = @X_LIB_DIR@
export X_INC_DIR  = @X_INC_DIR@

# GNU stuff
export BUILD_GETOPT = @BUILD_GETOPT@
export BUILD_REGEX  = @BUILD_REGEX@

# Where the CCTK puts things
export PACKAGE_DIR = $(CCTK_HOME)/@PACKAGE_DIR@
export BUILD_DIR   = $(TOP)/@BUILD_DIR@
export CCTK_LIBDIR = $(TOP)/@CCTK_LIBDIR@

# The perl scripts run by the make system
export BUILD_ACTIVETHORNS = @BUILD_ACTIVETHORNS@
export CST = @CST@

export C_FILE_PROCESSOR = @C_FILE_PROCESSOR@
export F_FILE_PROCESSOR = @F_FILE_PROCESSOR@

# The directory in which to place the executable
export EXEDIR = @EXEDIR@

# The name of the executable
export EXE    = @EXE@


# Is this a debug configuration ?
export CCTK_DEBUG_MODE = @DEBUG_MODE@

ifeq ($(strip $(CCTK_DEBUG_MODE)),yes)
  CPPFLAGS  += $(CPP_DEBUG_FLAGS)
  FPPFLAGS  += $(FPP_DEBUG_FLAGS)
  CFLAGS    += $(C_DEBUG_FLAGS)
  CXXFLAGS  += $(CXX_DEBUG_FLAGS)
  CUCCFLAGS += $(CUCC_DEBUG_FLAGS)
  F77FLAGS  += $(F77_DEBUG_FLAGS)
  F90FLAGS  += $(F90_DEBUG_FLAGS)
endif

# Is this an optimising configuration ?
export CCTK_OPTIMISE_MODE = @OPTIMISE_MODE@

ifeq ($(strip $(CCTK_OPTIMISE_MODE)),yes)
  CPPFLAGS  += $(CPP_OPTIMISE_FLAGS)
  FPPFLAGS  += $(FPP_OPTIMISE_FLAGS)
  CFLAGS    += $(C_OPTIMISE_FLAGS)
  CXXFLAGS  += $(CXX_OPTIMISE_FLAGS)
  CUCCFLAGS += $(CUCC_OPTIMISE_FLAGS)
  F77FLAGS  += $(F77_OPTIMISE_FLAGS)
  F90FLAGS  += $(F90_OPTIMISE_FLAGS)
else
  CFLAGS    += $(C_NO_OPTIMISE_FLAGS)
  CXXFLAGS  += $(CXX_NO_OPTIMISE_FLAGS)
  CUCCFLAGS += $(CUCC_NO_OPTIMISE_FLAGS)
  F77FLAGS  += $(F77_NO_OPTIMISE_FLAGS)
  F90FLAGS  += $(F90_NO_OPTIMISE_FLAGS)
endif

# Is this a profiling configuration ?
export CCTK_PROFILE_MODE = @PROFILE_MODE@

ifeq ($(strip $(CCTK_PROFILE_MODE)),yes)
  CPPFLAGS  += $(CPP_PROFILE_FLAGS)
  FPPFLAGS  += $(FPP_PROFILE_FLAGS)
  CFLAGS    += $(C_PROFILE_FLAGS)
  CXXFLAGS  += $(CXX_PROFILE_FLAGS)
  CUCCFLAGS += $(CUCC_PROFILE_FLAGS)
  F77FLAGS  += $(F77_PROFILE_FLAGS)
  F90FLAGS  += $(F90_PROFILE_FLAGS)
endif

# Are we building with OpenMP support ?
export CCTK_OPENMP_MODE = @OPENMP_MODE@

ifeq ($(strip $(CCTK_OPENMP_MODE)),yes)
  CPPFLAGS  += $(CPP_OPENMP_FLAGS)
  FPPFLAGS  += $(FPP_OPENMP_FLAGS)
  CFLAGS    += $(C_OPENMP_FLAGS)
  CXXFLAGS  += $(CXX_OPENMP_FLAGS)
  CUCCFLAGS += $(CUCC_OPENMP_FLAGS)
  F77FLAGS  += $(F77_OPENMP_FLAGS)
  F90FLAGS  += $(F90_OPENMP_FLAGS)
endif

# Are we building with all warnings switched on ?
# This option may be overwritten at compile time.
ifeq ($(WARN),)
  export CCTK_WARN_MODE = @WARN_MODE@
else
  export CCTK_WARN_MODE = $(WARN)
endif

ifeq ($(strip $(CCTK_WARN_MODE)),yes)
  CPPFLAGS  += $(CPP_WARN_FLAGS)
  FPPFLAGS  += $(FPP_WARN_FLAGS)
  CFLAGS    += $(C_WARN_FLAGS)
  CXXFLAGS  += $(CXX_WARN_FLAGS)
  CUCCFLAGS += $(CUCC_WARN_FLAGS)
  F77FLAGS  += $(F77_WARN_FLAGS)
  F90FLAGS  += $(F90_WARN_FLAGS)
endif

# Stuff specific to an architecture.
include $(TOP)/config-data/make.arch.defn
