# -*- mode: makefile -*-
#
# Makefile of ROOT for DEC OSF1 with KCC compiler

PLATFORM      = alpha

# When changing OPT to -O you can also change +K0 to +K1

DEBUGFLAGS    = -g +K0 -O0
OPTFLAGS      = -O4 +K3
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT           = -g
CXXOPT        = +K0 -O0
NOOPT         =
else
OPT           = -O4
CXXOPT        = +K3
NOOPT         =
endif

ifeq ($(EXCEPTIONS),yes)
EXCEPTION     = --exceptions -DG__EXCEPTIONWRAPPER
else
EXCEPTION     = --no_exceptions
endif

ifeq ($(ENABLETHREAD),yes)
CXXOPT        += --thread_safe
endif

# Compiler:
CXX           = KCC
CC            = cc
CXXFLAGS      = $(EXCEPTION) --signed_chars --display_error_number --diag_suppress 68 \
                --diag_suppress 191 --diag_suppress 830 \
                $(CXXOPT) -D__osf__ -D__alpha $(EXTRA_CXXFLAGS)
CFLAGS        = -signed -D__osf__ -D__alpha $(EXTRA_CFLAGS)
CINTCXXFLAGS  = $(EXCEPTION) --signed_chars --display_error_number \
                --diag_suppress 68 --diag_suppress 191 --diag_suppress 830 \
                -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
                -DG__OSFDLL -DG__SIGNEDCHAR -DG__ROOT \
                -DG__REDIRECTIO -DG__64BIT \
                $(CXXOPT) $(EXTRA_CXXFLAGS) --one_instantiation_per_object
CINTCFLAGS    = -signed -w -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
                -DG__OSFDLL -DG__SIGNEDCHAR -DG__ROOT \
                -DG__REDIRECTIO -DG__64BIT -D__KCC $(EXTRA_CFLAGS)
ifeq ($(EXCEPTIONS),yes)
CINTCFLAGS   += -DG__EXCEPTIONWRAPPER
endif

# Linker:
LD            = KCC
LDFLAGS       = $(CXXOPT) $(EXCEPTION) $(EXTRA_LDFLAGS)
AR            = KCC
ARFLAGS       = $(CXXOPT) $(EXCEPTION)
SOFLAGS       = --COMPDO_ln_dy '-expect_unresolved *'
SOEXT         = so

# System libraries:
SYSLIBS       = -lm
XLIBS         = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -lX11
CILIBS        = -lm -ltermcap -lbsd
CRYPTLIBS     = -lcrypt

# Fortran:
F77           = f77
F77FLAGS      = -O0 -recursive -nofor_main
F77LIBS       = /usr/lib/libfor.a -lUfor -lFutil

# Extras
CORELIBDEP    = $(G3DLIB) $(GRAFLIB) $(HISTLIB) $(MATRIXLIB)

# Override default in Makefile.config
INSTALL        := cp -pR
INSTALLDATA    := cp -pR

