# Variable(s) to declare the project compilation and execution environment.

ifeq (,$(MAKEFILE_PENV_VARS))
MAKEFILE_PENV_VARS = TRUE

ifeq (,$(PENV))
PENV = SGI
endif

ifeq (SGI,$(PENV))
  # Defines the binary format (o32 vs. n32) for compiling.
  
  # This is the default binformat if it is not overridden in a sub-Makefile.
  DEFAULT_BINFORMAT = n32
   
  ifeq ($(SGI_BINFORMAT),)
    SGI_BINFORMAT = $(DEFAULT_BINFORMAT)
  endif
  
  ifeq ($(SGI_BINFORMAT),o32)
    SGI_BINFORMAT_CC = -mips2 -o32
    SGI_BINFORMAT_SALIVATE = -o32
    SGI_BINFORMAT_LIB = lib
  else
    SGI_BINFORMAT_CC = -mips3 -n32
    SGI_BINFORMAT_SALIVATE = -n32
    SGI_BINFORMAT_LIB = lib32
  endif

  # Legacy.
  PYTHON_INCLUDE = /usr/local/include/python1.6
  NSPR_PATH = /for/program/mozilla/dist/IRIX6.5_n32_PTH_DBG.OBJ
  NSPR_INCLUDE = $(NSPR_PATH)/include
  NSPR_LIB = $(NSPR_PATH)/lib

  SYSTEM_IGATE_FLAGS = -D__mips__ -D__MIPSEB__ -DPENV_SGI
endif

ifeq (OSX,$(PENV))
  SYSTEM_IGATE_FLAGS =
endif

ifeq (Linux,$(PENV))

  SYSTEM_IGATE_FLAGS = -D__i386__ -DPENV_LINUX

  # Legacy.
  PYTHON_INCLUDE = /usr/local/include/python1.6
  NSPR_PATH = /usr/local/mozilla/dist/Linux2.2.10_x86_PTH_DBG.OBJ
  NSPR_INCLUDE = $(NSPR_PATH)/include
  NSPR_LIB = $(NSPR_PATH)/lib

endif

ifeq (WIN32,$(PENV))

  # Guarantee that PENV_COMPILER gets set to default to VC
  PENV_COMPILER = WIN32_VC

  SYSTEM_IGATE_FLAGS = -longlong __int64 -D_X86_ -DPENV_WIN32 -DWIN32_VC -D"_declspec(param)="

  # Windows is always a deferred build.
  USE_DEFERRED := yes

endif # WIN32 


endif   # MAKEFILE_PENV_VARS

