# -*- mode: makefile -*-
#
# Makefile of ROOT for Solaris with KCC

PLATFORM      = solaris

DEBUGFLAGS    = +K0 -O0 -g
OPTFLAGS      = -O4 +K1
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT           = -g
CXXOPT        = +K0 -O0
NOOPT         =
else
OPT           = -O4
CXXOPT        = +K1
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            = /opt/SUNWspro/bin/cc
CXXFLAGS      = $(EXCEPTION) --display_error_number $(EXTRA_CXXFLAGS) \
                --diag_suppress 191 --diag_suppress 830 \
                --one_instantiation_per_object \
                $(CXXOPT) -KPIC -I/usr/openwin/include
CFLAGS        = -KPIC -I/usr/openwin/include -O0 $(EXTRA_CFLAGS)
CINTCXXFLAGS  = $(EXCEPTION) --display_error_number $(EXTRA_CXXFLAGS) \
                --diag_suppress 191 --diag_suppress 830 \
                --one_instantiation_per_object $(CXXOPT) \
                -KPIC -DG__REGEXP1 -DG__UNIX -DG__OSFDLL \
                -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO
CINTCFLAGS    = -KPIC -DG__REGEXP1 -DG__UNIX -DG__OSFDLL \
                -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO \
                -D__KCC $(EXTRA_CFLAGS)

ifeq ($(EXCEPTIONS),yes)
CINTCFLAGS   += -DG__EXCEPTIONWRAPPER
endif

# Linker:
LD            = KCC
LDFLAGS       = $(OPT) $(CXXOPT) $(EXCEPTION) $(EXTRA_LDFLAGS)
AR            = KCC
ARFLAGS       = $(OPT) $(CXXOPT) $(EXCEPTION)
SOFLAGS       = -G
SOEXT         = so

# System libraries:
SYSLIBS       = -lm -ldl -lsocket -lnsl
XLIBS         = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -lX11
CILIBS        = -lm -ltermcap -ldl -L/usr/ccs/lib -lgen
CRYPTLIBS     =

# Fortran:
F77           = f77
F77FLAGS      =
F77LIBS       = -L/opt/SUNWspro/lib -lM77 -lF77 -lsunmath

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