# -*- mode: makefile -*-
#
# Makefile of ROOT for Windows with gcc compiler in Cygwin environment

PLATFORM      = linux

DEBUGFLAGS    = -g
OPTFLAGS      = -O3 -foptimize-sibling-calls -finline-functions
ifeq (debug,$(findstring debug,$(ROOTBUILD)))
OPT           = $(DEBUGFLAGS)
NOOPT         =
else
OPT           = $(OPTFLAGS)
NOOPT         =
endif

# Compiler:
CXX           = g++
CC            = gcc
CXXFLAGS      = -pipe -Wall -Woverloaded-virtual -D_DLL $(EXTRA_CXXFLAGS) \
                -I/usr/X11R6/include
CFLAGS        = -pipe -Wall -D_DLL $(EXTRA_CFLAGS) -I/usr/X11R6/include
CINTCXXFLAGS  = -pipe -Wall -Woverloaded-virtual -D_DLL $(EXTRA_CXXFLAGS) \
                -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
                -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__CYGWIN \
                -DG__NEWSTDHEADER
CINTCFLAGS    = -pipe -Wall -D_DLL $(EXTRA_CFLAGS) \
                -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \
                -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__CYGWIN \
                -DG__NEWSTDHEADER
COMPILER      = gnu

# Linker:
LD            = build/unix/wingcc_ld.sh
LDFLAGS       = $(OPT) --Wl,--enable-auto-image-base -Wl,--export-all-symbols \
                -L/usr/X11R6/lib \
                $(EXTRA_LDFLAGS)
SOFLAGS       = -shared -Wl,-soname,
# that's what cygwin ld looks for when searching for shared libs
SOEXT         = dll
EXEEXT        = .exe

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

# Fortran:
F77           = g77
F77FLAGS      =
F77LIBS       = -lg2c

# Extras
