#------------------------------------------------------------------------------
# Copyright 1996-2016 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#------------------------------------------------------------------------------
#
#  NSSDC/CDF					Makefile for CDF distribution.
#
#  Version 1.0, 2-Feb-05, SPDF/GSFC/NASA.
#
#  Modification history:
#
#   V1.0  02-Feb-05, M Liu 	Original version.
#   V1.1  30-May-05, M Liu      Changed the Fortran compiler to g95 (from f77),
#                               an open source, if possible. 
#   V1.2  11-Jul-05, M Liu      Added MinGW port for PC.
#   V1.3  30-Jan-06, M Liu      Added FreeBSD for PC.
#   V1.4   1-Feb-06, M Liu      Added Intel C port for linux.
#   V1.5  19-Jun-06, M Liu      Added AIX and HP-UX ports.
#   V1.6  23-Aug-06, M Liu      Added cdfirdump and cdfmerge.
#   V1.7  12-Feb-07, D Berger   Added -ff2c to the linux, gnu fortran compiler
#                               options.
#   V1.8  04-May-07, D Berger   Added UCOPTIONS and removed -ff2c.            
#   V1.9  28-Apr-09, M Liu      Added linux/gnu64 combination.
#   V1.10 16-Dec-10, M Liu      Moodified to make it work for both Mac OS X
#                               10.5 and 10.6.
#   V1.11 21-Mar-11, M Liu      No longer support for g77. Use gfortran or g95.
#   V1.12 21-Jul-11, M Liu      Modified to support 64-bit Solaris on Intel 
#                               with Sunstudio and gnu compilers.
#   V1.13 18-Jun-12, M Liu      Modified to support shared library for
#                               Cygwin and Mingw.
#   V2.0  20-Feb-16, M Liu      Added version to dynamic library name for Mac.
#                               Mac OS to build both 32 and 64-bit universal
#                               binary for libraries and tools.
#   V3.0  16-Mar-20, M Liu      For Mac OS X, Xcode version 10 or newer 
#                               will only build x86_64 application. Only
#                               older versions can make both 32 and 64-mode.
#   V3.8  26-Jun-20, M Liu      Added JNI compilation.
#   V3.9   8-Jan-21, M Liu      Added no string overflow check for gnu C and
#                               no print directory for gnu make.
#   V3.10 18-Feb-23, M Liu      Moved src/tests directory up as cdf_tests in
#                               the main distribution.
#------------------------------------------------------------------------------
#
# Notes:
#
# `make' on DECstations complains (prints a error message) if an if-then-else
# construct evaluates to FALSE but there is no `false' part.  To prevent this,
# the `NULL' command is executed as the `false' part.
#
#------------------------------------------------------------------------------

.SILENT:

SHELL=/bin/bash
NULL=true
PART=all
TARGET=
SOURCE=
SRCLIB=
DESTINATION=
VERSION=3.9.2
JDK_HOME=
JNIOS=

#------------------------------------------------------------------------------
# Directory locations.
#------------------------------------------------------------------------------

SRCDIRx=$(dir $(firstword $(MAKEFILE_LIST)))
SRCDIR=$(abspath $(SRCDIRx))

DEFSsrcDIR=$(SRCDIR)/src/definitions
INCsrcDIR=$(SRCDIR)/src/include
LIBsrcDIR=$(SRCDIR)/src/lib
TOOLSsrcDIR=$(SRCDIR)/src/tools
TESTSsrcDIR=$(SRCDIR)/cdf_tests
HELPsrcDIR=$(SRCDIR)/src/help
zLIBsrcDIR=$(LIBsrcDIR)/zlib
JNIsrcDIR=$(SRCDIR)/cdfjava/jni

MYHOME=$(shell printenv HOME)

#------------------------------------------------------------------------------
# Macros specified on the `make' command line.
#------------------------------------------------------------------------------

FORTRAN=no
CURSES=yes
SHARED=yes
OS=
ENV=
INSTALLDIR=.
UCOPTIONS=
JNI=no
INSTALLDIRx=$(abspath $(INSTALLDIR))

#------------------------------------------------------------------------------
# Other macros.
#------------------------------------------------------------------------------
MAKEFILE=Makefile-classic
BLDDIR=$(shell pwd)
DIFFDIRS=0
ifneq ("$(SRCDIR)", "$(BLDDIR)")
  DIFFDIRS=1
  BLDLIBsrcDIR=$(BLDDIR)/src/lib
  BLDzLIBsrcDIR=$(BLDDIR)/src/lib/zlib
  BLDTOOLSsrcDIR=$(BLDDIR)/src/tools
  BLDTESTSsrcDIR=$(BLDDIR)/cdf_tests
else
  BLDLIBsrcDIR=$(LIBsrcDIR)
  BLDzLIBsrcDIR=$(zLIBsrcDIR)
  BLDTOOLSsrcDIR=$(TOOLSsrcDIR)
  BLDTESTSsrcDIR=$(TESTSsrcDIR)
endif

LDLIB=
EXTRAMAKE=--no-print-directory
EXTRAMAKE1=-f $(SRCDIR)/$(MAKEFILE)
EXTRAMAKE2=-f $(MAKEFILE)
ifeq ("$(OS)","solaris")
  ifeq ("$(ENV)","x86")
    EXTRAMAKE1+= --no-print-directory
    EXTRAMAKE2+= --no-print-directory
    MAKE=gmake
  else
    ifeq ("$(ENV)","x64")
      EXTRAMAKE1+= --no-print-directory
      EXTRAMAKE2+= --no-print-directory
      MAKE=gmake
    else
      MAKE=make
    endif
  endif
else
  MORE=$(shell uname -a | cut -f5 -d " ")
  ifeq ("$(MORE)","i86pc")
    EXTRAMAKE1+= --no-print-directory
    EXTRAMAKE2+= --no-print-directory
    MAKE=gmake
  else
    GNU=$(shell make --version | head -1 | cut -f1 -d' ')
    ifeq ("$(GNU)","GNU")
      EXTRAMAKE1+= --no-print-directory
      EXTRAMAKE2+= --no-print-directory
      MAKE=make
    else
      MAKE=make
    endif
  endif
endif
#RANLIB=gcc-ranlib
RANLIB=ranlib

WHICHOS=$(shell uname)
MACVERSION=0
XCODEVERSION=
XCODEVERSION2=0
ifeq ("$(WHICHOS)","Darwin")
  MACVERSION=$(shell uname -r | cut -f1 -d.)
  XCODEVERSION=$(shell /usr/bin/xcodebuild -version | sed '2d' | cut -f2 -d' ')
  XCODEVERSION2=$(shell echo $(XCODEVERSION) | cut -f1 -d.)
  FORJNI=/Contents/Home
else
  FORJNI=
endif

JAVA_HOME=
ifneq ("$(JDK_HOME)","")
  JAVA_HOME=$(JDK_HOME)$(FORJNI)
else
  WHICHJDK=$(shell printenv JDK_HOME)
  ifneq ("$(WHICHJDK)","")
    JAVA_HOME=$(WHICHJDK)$(FORJNI)
  else
    WHICHJDK=$(shell printenv ENV_JDK_HOME)
    ifneq ("$(WHICHJDK)", "")
      JAVA_HOME=$(WHICHJDK)$(FORJNI)
    else
      WHICHJDK=$(shell printenv JAVA_HOME)
      ifneq ("$(WHICHJDK)", "")
        JAVA_HOME=$(WHICHJDK)$(FORJNI)
      endif
    endif
  endif
endif

JNI2=$(JNI)
ifeq ("$(JNI)","yes")
  ifneq ("$(JAVA_HOME)","")
    JNI_FILE=$(JAVA_HOME)/include/jni.h
    TEST_JNI=$(shell test -e "$(JNI_FILE)" && echo yes)
    ifneq ($(TEST_JNI), yes)
      JNI2=no 
    endif
  else
    JNI2=no
  endif
endif

ifneq ($(BLDDIR), $(SRCDIR))
  BLDJNIsrcDIR=$(BLDDIR)/cdfjava/jni
else
  BLDJNIsrcDIR=$(SRCDIR)/cdfjava/jni
endif

#------------------------------------------------------------------------------
# Macros for Solaris.
#------------------------------------------------------------------------------

SHARED_solaris=yes
FOPTIONS_solaris=-w
FOPTIONSld_solaris=
SHAREDEXT_solaris=so
AROPTIONS_solaris=rc
RANLIB_solaris=no
FC_solaris=f90
EXEEXT_solaris=
JNIOS_solaris=solaris
JNIEXT_solaris=so

CURSES_solaris_sparc=yes
CC_solaris_sparc=cc
LD_solaris_sparc=ld
ARCH_solaris_sparc=
ARCH2_solaris_sparc=
ARCH3_solaris_sparc=setup
LDOPTIONS_solaris_sparc=-G
PIC_solaris_sparc=-Kpic
COPTIONS_solaris_sparc=-DSOLARIS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -xO2
COPTIONSZlib_solaris_sparc=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_sparc=
FOPTIONS_solaris_sparc=-ext_names=fsecond-underscore
FOPTIONSld_solaris_sparc=
CURSESLIB_solaris_sparc=-lcurses
SYSLIBSexe_solaris_sparc=-lm
SYSLIBSshr_solaris_sparc=

CURSES_solaris_sparc64=yes
CC_solaris_sparc64=cc
LD_solaris_sparc64=ld
ARCH_solaris_sparc64=
ARCH2_solaris_sparc64=64
ARCH3_solaris_sparc64=setup
LDOPTIONS_solaris_sparc64=-G
PIC_solaris_sparc64=-Kpic
COPTIONS_solaris_sparc64=-m64 -xarch=sparcvis -DSOLARIS -DSOLARIS64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -xO2
COPTIONSZlib_solaris_sparc64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_sparc64=-m64 -xarch=sparcvis
FOPTIONS_solaris_sparc64=-m64 -ext_names=fsecond-underscore
FOPTIONSld_solaris_sparc64=-m64
CURSESLIB_solaris_sparc64=-lcurses
SYSLIBSexe_solaris_sparc64=-L/usr/local/lib/sparcv9 -lm
SYSLIBSshr_solaris_sparc64=

CURSES_solaris_gnu=yes
CC_solaris_gnu=gcc
LD_solaris_gnu=gcc
ARCH_solaris_gnu=
ARCH2_solaris_gnu=
ARCH3_solaris_gnu=setup
LDOPTIONS_solaris_gnu=-shared 
PIC_solaris_gnu=-fpic
COPTIONS_solaris_gnu=-DSOLARIS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_solaris_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_gnu=
FOPTIONS_solaris_gnu=-ext_names=fsecond-underscore
FOPTIONSld_solaris_gnu=
CURSESLIB_solaris_gnu=-lcurses
SYSLIBSexe_solaris_gnu=-lm
SYSLIBSshr_solaris_gnu=

CURSES_solaris_gnu64=yes
CC_solaris_gnu64=gcc
LD_solaris_gnu64=gcc
ARCH_solaris_sparc64=
ARCH2_solaris_sparc64=64
ARCH3_solaris_sparc64=setup
LDOPTIONS_solaris_gnu64=-shared -m64 
PIC_solaris_gnu64=-fpic
COPTIONS_solaris_gnu64=-DSOLARIS -DSOLARIS64 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_solaris_gnu64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_gnu64=-m64
FOPTIONS_solaris_gnu64=-m64 -ext_names=fsecond-underscore
FOPTIONSld_solaris_gnu64=-m64
CURSESLIB_solaris_gnu64=-lcurses
SYSLIBSexe_solaris_gnu64=-L/usr/local/lib/sparcv9 -lm
SYSLIBSshr_solaris_gnu64=

CURSES_solaris_gnu64i=yes
CC_solaris_gnu64i=gcc
LD_solaris_gnu64i=gcc
ARCH_solaris_gnu64i=
ARCH2_solaris_gnu64i=64
ARCH3_solaris_gnu64i=setup
LDOPTIONS_solaris_gnu64i=-shared -m64 
PIC_solaris_gnu64i=-fpic
COPTIONS_solaris_gnu64i=-DSOLARIS -DSOLARIS64 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2 -DX64
COPTIONSZlib_solaris_gnu64i=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_gnu64i=-m64
FOPTIONS_solaris_gnu64i=-m64
FOPTIONSld_solaris_gnu64i=-m64
CURSESLIB_solaris_gnu64i=-lcurses
SYSLIBSexe_solaris_gnu64i=-lm
SYSLIBSshr_solaris_gnu64i=

CURSES_solaris_x86=yes
CC_solaris_x86=cc
LD_solaris_x86=ld
ARCH_solaris_x86=
ARCH2_solaris_x86=
ARCH3_solaris_x86=setup
LDOPTIONS_solaris_x86=-G
PIC_solaris_x86=-Kpic
COPTIONS_solaris_x86=-DSOLARIS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O
COPTIONSZlib_solaris_x86=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_x86=
FOPTIONS_solaris_x86=
FOPTIONSld_solaris_x86=
CURSESLIB_solaris_x86=-lcurses
SYSLIBSexe_solaris_x86=-lm
SYSLIBSshr_solaris_x86=

CURSES_solaris_x64=yes
CC_solaris_x64=cc
LD_solaris_x64=ld -64
ARCH_solaris_x64=
ARCH2_solaris_x64=64
ARCH3_solaris_x64=setup
LDOPTIONS_solaris_x64=-G
PIC_solaris_x64=-Kpic
COPTIONS_solaris_x64=-DSOLARIS -DSOLARIS64 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DX64 -O
COPTIONSZlib_solaris_x64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_solaris_x64=-m64
FOPTIONS_solaris_x64=-m64
FOPTIONSld_solaris_x64=-m64
CURSESLIB_solaris_x64=-lcurses
SYSLIBSexe_solaris_x64=-lm
SYSLIBSshr_solaris_x64=

#------------------------------------------------------------------------------
# Macros for MacosX.
#------------------------------------------------------------------------------

SHARED_macosx=yes
FOPTIONS_macosx=
FOPTIONSld_macosx=
SHAREDEXT_macosx=dylib
AROPTIONS_macosx=rc
RANLIB_macosx=yes
EXEEXT_macosx=
MACOSxlink=
MACOSxFopt=
FORTWARN=
WHICHOS=$(shell uname)
ifeq ("$(WHICHOS)","Darwin")
  KERNELVERSION=$(shell uname -r | cut -f1 -d.)
  ifeq ("$(KERNELVERSION)","9")
    MACOSxlink=-L/usr/lib/gcc/i686-apple-darwin9/4.2.1 -lm -lc -lgcc
  else
    MACOSxlink=-lc -lm
    MACOSxFopt=-m64
  endif
  ifeq ($(shell test $(KERNELVERSION) -gt 19; echo $$?),0)
#   Big Sur or Monterey or later
    XCODEDir=$(shell xcode-select -p)
    LDLIB=-L$(XCODEDir)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
    FORTWARN=-w -fallow-argument-mismatch
  endif
endif
FC_macosx=gfortran $(FORTWARN)
JNIOS_macosx=darwin
JNIEXT_macosx=jnilib

CURSES_macosx_gnu32=yes
CC_macosx_gnu32=gcc
LD_macosx_gnu32=libtool
ARCH_macosx_gnu32=2
ARCH2_macosx_gnu32=32
ARCH3_macosx_gnu32=setup
LDOPTIONS_macosx_gnu32=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0
PIC_macosx_gnu32=-fPIC
COPTIONS_macosx_gnu32=-m32 -D__MACH__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_macosx_gnu32=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_macosx_gnu32=
FOPTIONS_macosx_gnu32=-w -m32
FOPTIONSld_macosx_gnu32=-m32
CURSESLIB_macosx_gnu32=-lcurses
SYSLIBSexe_macosx_gnu32=$(MACOSxlink) -m32
SYSLIBSshr_macosx_gnu32=$(MACOSxlink) -m32

CURSES_macosx_gnu=yes
CC_macosx_gnu=gcc
LD_macosx_gnu=libtool
ARCH_macosx_gnu=
ARCH2_macosx_gnu=
ARCH3_macosx_gnu=setup
LDOPTIONS_macosx_gnu=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0
PIC_macosx_gnu=-fPIC
COPTIONS_macosx_gnu=-m64 -D__MACH__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_macosx_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_macosx_gnu=
FOPTIONS_macosx_gnu=-w $(MACOSxFopt)
FOPTIONSld_macosx_gnu=$(MACOSxFopt)
CURSESLIB_macosx_gnu=-lcurses
SYSLIBSexe_macosx_gnu=$(MACOSxlink)
SYSLIBSshr_macosx_gnu=$(MACOSxlink)

CURSES_macosx_ppc=yes
CC_macosx_ppc=gcc
LD_macosx_ppc=libtool -syslibroot /Developer/SDKs/MacOSX10.5.sdk -arch_only ppc
ARCH_macosx_ppc=
ARCH2_macosx_ppc=
ARCH3_macosx_ppc=setup
LDOPTIONS_macosx_ppc=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0
PIC_macosx_ppc=-fPIC
COPTIONS_macosx_ppc=-isysroot/Developer/SDKs/MacOSX10.5.sdk -arch ppc -D__ppc__ -D__MACH__ -D__APPLE__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_macosx_ppc=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_macosx_ppc=-arch ppc -isysroot/Developer/SDKs/MacOSX10.5.sdk
FOPTIONS_macosx_ppc=-w
FOPTIONSld_macosx_ppc=
CURSESLIB_macosx_ppc=-lcurses
SYSLIBSexe_macosx_ppc=-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib -L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 -lm -lc -lgcc
SYSLIBSshr_macosx_ppc=-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib -L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 -lm -lc -lgcc

CURSES_macosx_ppc64=yes
CC_macosx_ppc64=gcc
LD_macosx_ppc64=libtool -syslibroot /Developer/SDKs/MacOSX10.5.sdk -arch_only ppc64
ARCH_macosx_ppc64=
ARCH2_macosx_ppc64=64
ARCH3_macosx_ppc64=setup
LDOPTIONS_macosx_ppc64=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0
PIC_macosx_ppc64=-fPIC
COPTIONS_macosx_ppc64=-isysroot/Developer/SDKs/MacOSX10.5.sdk -arch ppc64 -m64 -DMACOSX64 -D__ppc__ -D__MACH__ -D__APPLE__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_macosx_ppc64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_macosx_ppc64=-arch ppc64 -isysroot/Developer/SDKs/MacOSX10.5.sdk
FOPTIONS_macosx_ppc64=-w
FOPTIONSld_macosx_ppc64=
CURSESLIB_macosx_ppc64=-lcurses
SYSLIBSexe_macosx_ppc64=-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib -L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/ppc64 -lm -lc -lgcc
SYSLIBSshr_macosx_ppc64=-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib -L/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/ppc64 -lm -lc -lgcc

COPTIONS_macosx=-D__MACH__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2

CURSES_macosx_i386=yes
CC_macosx_i386=clang
ifeq ($(shell test $(XCODEVERSION2) -lt 10; echo $$?),0)
  COPTIONS_macosx_i386=-arch i386 -arch x86_64 -Di386 $(COPTIONS_macosx)
  COPTIONSld_macosx_i386=-arch i386 -arch x86_64
endif
LD_macosx_i386=libtool
ARCH_macosx_i386=2
ARCH2_macosx_i386=32
ARCH3_macosx_i386=setup
#LDOPTIONS_macosx_i386=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib -install_name @rpath/../lib/libcdf.dylib
LDOPTIONS_macosx_i386=-dynamic -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib
PIC_macosx_i386=-fPIC
COPTIONSZlib_macosx_i386=-DHAVE_STDARG_H -DHAVE_UNISTD_H
FOPTIONS_macosx_i386=-w -m32
FOPTIONSld_macosx_i386=-m32
CURSESLIB_macosx_i386=-lcurses
SYSLIBSexe_macosx_i386=-lc -lm 
SYSLIBSshr_macosx_i386=-lc -lm 

CURSES_macosx_x86_64=yes
CC_macosx_x86_64=clang
ifeq ($(shell test $(XCODEVERSION2) -gt 9; echo $$?),0)
  COPTIONS_macosx_x86_64=-arch x86_64 -Di386 $(COPTIONS_macosx)
  COPTIONSld_macosx_x86_64=-arch x86_64
else
  COPTIONS_macosx_x86_64=-arch x86_64 -Di386 $(COPTIONS_macosx)
  COPTIONSld_macosx_x86_64=-arch x86_64
endif
LD_macosx_x86_64=clang
ARCH_macosx_x86_64=2
ARCH2_macosx_x86_64=64
ARCH3_macosx_x86_64=setup
LDOPTIONS_macosx_x86_64=-arch x86_64 -dynamic -dylib -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib -install_name @rpath/libcdf.dylib
#LDOPTIONS_macosx_x86_64=-arch x86_64 -dynamic -dylib -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib
PIC_macosx_x86_64=-fPIC
COPTIONSZlib_macosx_x86_64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
FOPTIONS_macosx_x86_64=-w -m64
FOPTIONSld_macosx_x86_64=-m64
CURSESLIB_macosx_x86_64=$(SRCDIR)/macosx/ncurses/lib/libncurses.a
SYSLIBSexe_macosx_x86_64=$(LDLIB) -lc -lm 
SYSLIBSshr_macosx_x86_64=$(LDLIB) -lc -lm 

WHICHARM=$(shell uname -m)
CARM=
ifeq ("$(WHICHARM)","arm64")
  CARM=-arch arm64
  FARM=-arch arm64
else
  ifeq ("$(WHICHARM)","arm")
    CARM=-arch arm32
    FARM=-m32
  else
    CARM=-arch arm64
    FARM=-m64
  endif
endif

CURSES_macosx_arm=yes
CC_macosx_arm=clang
COPTIONS_macosx_arm=$(COPTIONS_macosx) $(CARM)
COPTIONSld_macosx_arm=$(CARM)
LD_macosx_arm=clang
ARCH_macosx_arm=3
ARCH2_macosx_arm=
ARCH3_macosx_arm=setup
LDOPTIONS_macosx_arm=-dynamic -dylib $(CARM) -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib -install_name @rpath/libcdf.dylib
#LDOPTIONS_macosx_arm=-dynamic -dylib $(CARM) -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib
PIC_macosx_arm=-fPIC
COPTIONSZlib_macosx_arm=-DHAVE_STDARG_H -DHAVE_UNISTD_H
FOPTIONS_macosx_arm=-w $(FARM)
FOPTIONSld_macosx_arm=$(FARM)
CURSESLIB_macosx_arm=$(SRCDIR)/macosx/ncurses/lib/libncurses.a
SYSLIBSexe_macosx_arm=$(LDLIB) -lc -lm 
SYSLIBSshr_macosx_arm=$(LDLIB) -lc -lm 

CURSES_macosx_arm64=yes
CC_macosx_arm64=clang
COPTIONS_macosx_arm64=$(COPTIONS_macosx) -arch arm64
COPTIONSld_macosx_arm64=-arch arm64
LD_macosx_arm64=clang
ARCH_macosx_arm64=3
ARCH2_macosx_arm64=64
ARCH3_macosx_arm64=setup
LDOPTIONS_macosx_arm64=-dynamic -dylib -arch arm64 -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib -install_name @rpath/libcdf.dylib
#LDOPTIONS_macosx_arm64=-dynamic -dylib -arch arm64 -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib
PIC_macosx_arm64=-fPIC
COPTIONSZlib_macosx_arm64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
FOPTIONS_macosx_arm64=-w $(FARM)
FOPTIONSld_macosx_arm64=$(FARM)
CURSESLIB_macosx_arm64=$(SRCDIR)/macosx/ncurses/lib/libncurses.a
SYSLIBSexe_macosx_arm64=$(LDLIB) -lc -lm 
SYSLIBSshr_macosx_arm64=$(LDLIB) -lc -lm 

CURSES_macosx_arm32=yes
CC_macosx_arm32=clang
COPTIONS_macosx_arm32=$(COPTIONS_macosx) -arch arm32
COPTIONSld_macosx_arm32=-arch arm32
LD_macosx_arm32=clang
ARCH_macosx_arm32=3
ARCH2_macosx_arm32=32
ARCH3_macosx_arm32=setup
LDOPTIONS_macosx_arm32=-dynamic -dylib -arch arm32 -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib -install_name @rpath/libcdf.dylib
#LDOPTIONS_macosx_arm32=-dynamic -dylib -arch arm32 -current_version $(VERSION) -compatibility_version 3.0.0 -dynamiclib
PIC_macosx_arm32=-fPIC
COPTIONSZlib_macosx_arm32=-DHAVE_STDARG_H -DHAVE_UNISTD_H
FOPTIONS_macosx_arm32=-w $(FARM)
FOPTIONSld_macosx_arm32=$(FARM)
CURSESLIB_macosx_arm32=-lcurses
SYSLIBSexe_macosx_arm32=$(LDLIB) -lc -lm 
SYSLIBSshr_macosx_arm32=$(LDLIB) -lc -lm 

#------------------------------------------------------------------------------
# Macros for OSF (Digital UNIX).
#------------------------------------------------------------------------------

SHARED_osf=yes
FOPTIONS_osf=-warn declarations -warn nounused
FOPTIONSld_osf=
SHAREDEXT_osf=so
AROPTIONS_osf=rc
RANLIB_osf=yes
FC_osf=f77
EXEEXT_osf=
JNIOS_osf=osf
JNIEXT_osf=so

CURSES_osf_dec=yes
CC_osf_dec=cc
LD_osf_dec=ld
ARCH_osf_dec=
ARCH2_osf_dec=
ARCH3_osf_dec=setup
LDOPTIONS_osf_dec=-shared -expect_unresolved '*'
PIC_osf_dec=
COPTIONS_osf_dec=-std1 -Dunix -ieee_with_inexact -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
COPTIONSZlib_osf_dec=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_osf_dec=
FOPTIONS_osf_dec=
FOPTIONSld_osf_dec=
CURSESLIB_osf_dec=-lcurses
SYSLIBSexe_osf_dec=-lm -lc
SYSLIBSshr_osf_dec=

CURSES_osf_gnu=yes
CC_osf_gnu=gcc
LD_osf_gnu=gcc
ARCH_osf_gnu=
ARCH2_osf_gnu=
ARCH3_osf_gnu=setup
LDOPTIONS_osf_gnu=-shared -expect_unresolved '*' 
PIC_osf_gnu=-fpic
COPTIONS_osf_gnu=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_osf_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_osf_gnu=
FOPTIONS_osf_gnu=
FOPTIONSld_osf_gnu=
CURSESLIB_osf_gnu=-lcurses
SYSLIBSexe_osf_gnu=-lm -lc
SYSLIBSshr_osf_gnu=

#------------------------------------------------------------------------------
# Macros for IRIX 6.x.
#------------------------------------------------------------------------------

SHARED_irix6=yes
FOPTIONS_irix6=-u
FOPTIONSld_irix6=
SHAREDEXT_irix6=so
AROPTIONS_irix6=rc
RANLIB_irix6=no
FC_irix6=f77
JNIOS_irix6=irix
JNIEXT_irix6=so

CURSES_irix6_sgin32=yes
CC_irix6_sgin32=cc
LD_irix6_sgin32=ld
ARCH_irix6_sgin32=
ARCH2_irix6_sgin32=32
ARCH3_irix6_sgin32=setup
LDOPTIONS_irix6_sgin32=-shared
PIC_irix6_sgin32=-KPIC
COPTIONS_irix6_sgin32=-n32 -woffall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
COPTIONSZlib_irix6_sgin32=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_irix6_sgin32=-n32 -L/usr/lib32
FOPTIONS_irix6_sgin32=-n32
FOPTIONSld_irix6_sgin32=-n32 -L/usr/lib32
CURSESLIB_irix6_sgin32=-lcurses
SYSLIBSexe_irix6_sgin32=-lm -lc
SYSLIBSshr_irix6_sgin32=-lm -lc

CURSES_irix6_sgi64=yes
CC_irix6_sgi64=cc
LD_irix6_sgi64=ld
ARCH_irix6_sgi64=
ARCH2_irix6_sgi64=64
ARCH3_irix6_sgi64=setup
LDOPTIONS_irix6_sgi64=-shared
PIC_irix6_sgi64=-KPIC
COPTIONS_irix6_sgi64=-64 -woffall -DIRIX64bit -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
COPTIONSZlib_irix6_sgi64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_irix6_sgi64=-64 -DIRIX64bit -L/usr/lib64
FOPTIONS_irix6_sgi64=-64
FOPTIONSld_irix6_sgi64=-64 -L/usr/lib64
CURSESLIB_irix6_sgi64=-lcurses
SYSLIBSexe_irix6_sgi64=-lm -lc
SYSLIBSshr_irix6_sgi64=-lm -lc

CURSES_irix6_gnu=yes
CC_irix6_gnu=gcc
LD_irix6_gnu=gcc
ARCH_irix6_gnu=
ARCH2_irix6_gnu=
ARCH3_irix6_gnu=setup
LDOPTIONS_irix6_gnu=-shared 
PIC_irix6_gnu=-fpic
COPTIONS_irix6_gnu=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_irix6_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_irix6_gnu=
FOPTIONS_irix6_gnu=
FOPTIONSld_irix6_gnu=
CURSESLIB_irix6_gnu=-lcurses
SYSLIBSexe_irix6_gnu=-lm -lc
SYSLIBSshr_irix6_gnu=

#------------------------------------------------------------------------------
# Macros for Linux.
#------------------------------------------------------------------------------

SHARED_linux=yes
FOPTIONS_linux=-w
FOPTIONSld_linux=
SHAREDEXT_linux=so
AROPTIONS_linux=rc
RANLIB_linux=yes
FC_linux=gfortran
JNIOS_linux=linux
JNIEXT_linux=so

CURSES_linux_gnu=yes
CC_linux_gnu=gcc
LD_linux_gnu=gcc
ARCH_linux_gnu=1
ARCH2_linux_gnu=
ARCH3_linux_gnu=setup
LDOPTIONS_linux_gnu=-shared 
PIC_linux_gnu=-fPIC
COPTIONS_linux_gnu=-Wno-stringop-overflow -Werror=strict-aliasing -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DMALLOC_CHECK_=0 -O3 
COPTIONSZlib_linux_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_linux_gnu=
FOPTIONS_linux_gnu=-fsecond-underscore
FOPTIONSld_linux_gnu=
CURSESLIB_linux_gnu=-lncursesw
SYSLIBSexe_linux_gnu=-lm -lc
SYSLIBSshr_linux_gnu=-lm -lc

CURSES_linux_gnu32=yes
CC_linux_gnu32=gcc
LD_linux_gnu32=gcc 
ARCH_linux_gnu32=1
ARCH2_linux_gnu32=32
ARCH3_linux_gnu32=setup
LDOPTIONS_linux_gnu32=-shared -m32 
PIC_linux_gnu32=-fPIC
COPTIONS_linux_gnu32=-w -Wno-stringop-overflow -Wold-style-definition -unused-variable -m32 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DMALLOC_CHECK_=0 -O2 
COPTIONSZlib_linux_gnu32=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_linux_gnu32=-m32
FOPTIONS_linux_gnu32=-m32 -fsecond-underscore
FOPTIONSld_linux_gnu32=-m32
CURSESLIB_linux_gnu32=-lncursesw
SYSLIBSexe_linux_gnu32=-lm -lc
SYSLIBSshr_linux_gnu32=-lm -lc

CURSES_linux_gnu64=yes
CC_linux_gnu64=gcc
LD_linux_gnu64=gcc
ARCH_linux_gnu64=1
ARCH2_linux_gnu64=64
ARCH3_linux_gnu64=setup
LDOPTIONS_linux_gnu64=-shared -m64 
PIC_linux_gnu64=-fPIC
COPTIONS_linux_gnu64=-w -m64 -I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DMALLOC_CHECK_=0 -O2 
COPTIONSZlib_linux_gnu64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_linux_gnu64=-m64
FOPTIONS_linux_gnu64=-m64 -fsecond-underscore
FOPTIONSld_linux_gnu64=-m64
CURSESLIB_linux_gnu64=-lncursesw
SYSLIBSexe_linux_gnu64=-lm -lc
SYSLIBSshr_linux_gnu64=-lm -lc

CURSES_linux_intel=yes
CC_linux_intel=icc
LD_linux_intel=ld
ARCH_linux_intel=
ARCH2_linux_intel=
ARCH3_linux_intel=setup
LDOPTIONS_linux_intel=-shared
PIC_linux_intel=-fPIC
COPTIONS_linux_intel=-I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DMALLOC_CHECK_=0
COPTIONSZlib_linux_intel=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_linux_intel=
FOPTIONS_linux_intel=
FOPTIONSld_linux_intel=
CURSESLIB_linux_intel=-lcurses
SYSLIBSexe_linux_intel=-lm -lc
SYSLIBSshr_linux_intel=-lm -lc

#------------------------------------------------------------------------------
# Macros for AIX.
#------------------------------------------------------------------------------

SHARED_aix=yes
FOPTIONS_aix=-u -qcharlen=256
FOPTIONSld_aix=-L../lib
SHAREDEXT_aix=o
AROPTIONS_aix=rc
AROPTIONS_aix64=-r -c -X 64
RANLIB_aix=yes
FC_aix=xlf
JNIOS_aix=aix
JNIEXT_aix=o

CURSES_aix_ibm=yes
CC_aix_ibm=cc
LD_aix_ibm=ld
ARCH_aix_ibm=
ARCH2_aix_ibm=
ARCH3_aix_ibm=setup
LDOPTIONS_aix_ibm=-bnoentry -bM:SRE -bE:libcdf.exp
PIC_aix_ibm=
COPTIONS_aix_ibm=-DIBMRS -DAIX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE 
COPTIONSZlib_aix_ibm=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_aix_ibm=-L../lib
FOPTIONS_aix_ibm=
FOPTIONSld_aix_ibm=-L../lib
CURSESLIB_aix_ibm=-lcurses
SYSLIBSexe_aix_ibm=-lm -lc
SYSLIBSshr_aix_ibm=-lm -lc

CURSES_aix_ibm64=yes
CC_aix_ibm64=cc
LD_aix_ibm64=ld
ARCH_aix_ibm64=
ARCH2_aix_ibm64=64
ARCH3_aix_ibm64=setup
LDOPTIONS_aix_ibm64=-b64 -bnoentry -bM:SRE -bE:libcdf.exp
PIC_aix_ibm64=
COPTIONS_aix_ibm64=-q64 -DIBMRS -DAIX -DAIX64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
COPTIONSZlib_aix_ibm64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_aix_ibm64=-q64 -L../lib
FOPTIONS_aix_ibm64=
FOPTIONSld_aix_ibm64=-L../lib
CURSESLIB_aix_ibm64=-lcurses
SYSLIBSexe_aix_ibm64=-lm -lc
SYSLIBSshr_aix_ibm64=-lm -lc

CURSES_aix_gnu=yes
CC_aix_gnu=gcc
LD_aix_gnu=gcc
ARCH_aix_gnu=
ARCH2_aix_gnu=
ARCH3_aix_gnu=setup
LDOPTIONS_aix_gnu=-shared 
PIC_aix_gnu=-fpic
COPTIONS_aix_gnu=-DIBMRS -DAIX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_aix_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_aix_gnu=-L../lib
FOPTIONS_aix_gnu=
FOPTIONSld_aix_gnu=-L../lib
CURSESLIB_aix_gnu=-lcurses
SYSLIBSexe_aix_gnu=-lm -lc
SYSLIBSshr_aix_gnu=-lm -lc

CURSES_aix_gnu64=yes
CC_aix_gnu64=gcc
LD_aix_gnu64=gcc
ARCH_aix_gnu64=
ARCH2_aix_gnu64=64
ARCH3_aix_gnu64=setup
LDOPTIONS_aix_gnu64=-shared -maix64 
PIC_aix_gnu64=-fpic
COPTIONS_aix_gnu64=-maix64 -DIBMRS -DAIX -DAIX64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_aix_gnu64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_aix_gnu64=-maix64 -L../lib
FOPTIONS_aix_gnu64=
FOPTIONSld_aix_gnu64=-L../lib
CURSESLIB_aix_gnu64=-lcurses
SYSLIBSexe_aix_gnu64=-lm -lc
SYSLIBSshr_aix_gnu64=-lm -lc

#------------------------------------------------------------------------------
# Macros for HP-UX.
# +DD64 for 64-bit mode (--LP64__ turned on)
# none  for 32-bit 
#------------------------------------------------------------------------------

SHARED_hpux=yes
FOPTIONS_hpux=-u
FOPTIONSld_hpux=
SHAREDEXT_hpux=sl
AROPTIONS_hpux=rc
RANLIB_hpux=no
FC_hpux=f77
JNIOS_hpux=hpux
JNIEXT_hpux=sl

CURSES_hpux_std=yes
CC_hpux_std=cc
LD_hpux_std=ld
ARCH_hpux_std=
ARCH2_hpux_std=
ARCH3_hpux_std=setup
LDOPTIONS_hpux_std=-b
PIC_hpux_std=
COPTIONS_hpux_std=-DHP -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE 
COPTIONSZlib_hpux_std=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_std=
FOPTIONS_hpux_std=
FOPTIONSld_hpux_std=
CURSESLIB_hpux_std=-lcurses
SYSLIBSexe_hpux_std=-lm -lc
SYSLIBSshr_hpux_std=

CURSES_hpux_opt=no
CC_hpux_opt=cc
LD_hpux_opt=ld
ARCH_hpux_opt=
ARCH2_hpux_opt=
ARCH3_hpux_opt=setup
LDOPTIONS_hpux_opt=-b
PIC_hpux_opt=+z
COPTIONS_hpux_opt=-w -DHP -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE 
COPTIONSZlib_hpux_opt=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_opt=
FOPTIONS_hpux_opt=
FOPTIONSld_hpux_opt=
CURSESLIB_hpux_opt=-lcurses
SYSLIBSexe_hpux_opt=-lm -lc
SYSLIBSshr_hpux_opt=

CURSES_hpux_opt64=no
CC_hpux_opt64=cc
LD_hpux_opt64=ld
ARCH_hpux_opt64=
ARCH2_hpux_opt64=64
ARCH3_hpux_opt64=setup
LDOPTIONS_hpux_opt64=-b
PIC_hpux_opt64=+z
COPTIONS_hpux_opt64=-w -DHP -DHP64 +DD64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE
COPTIONSZlib_hpux_opt64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_opt64=+DD64
FOPTIONS_hpux_opt64=
FOPTIONSld_hpux_opt64=
CURSESLIB_hpux_opt64=-lcurses
SYSLIBSexe_hpux_opt64=-lm -lc
SYSLIBSshr_hpux_opt64=

CURSES_hpux_posix=yes
CC_hpux_posix=c89
LD_hpux_posix=ld
ARCH_hpux_posix=
ARCH2_hpux_posix=
ARCH3_hpux_posix=setup
LDOPTIONS_hpux_posix=-b
PIC_hpux_posix=+z
COPTIONS_hpux_posix=-DHPUXposix -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE 
COPTIONSZlib_hpux_posix=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_posix=
FOPTIONS_hpux_posix=
FOPTIONSld_hpux_posix=
CURSESLIB_hpux_posix=-lcurses
SYSLIBSexe_hpux_posix=-lm -lc
SYSLIBSshr_hpux_posix=

CURSES_hpux_gnu=no
CC_hpux_gnu=gcc
LD_hpux_gnu=gcc
ARCH_hpux_gnu=
ARCH2_hpux_gnu=
ARCH3_hpux_gnu=setup
LDOPTIONS_hpux_gnu=-shared 
PIC_hpux_gnu=-fpic
COPTIONS_hpux_gnu=-DHP -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_hpux_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_gnu=
FOPTIONS_hpux_gnu=
FOPTIONSld_hpux_gnu=
CURSESLIB_hpux_gnu=-lcurses
SYSLIBSexe_hpux_gnu=-lm -lc
SYSLIBSshr_hpux_gnu=

CURSES_hpux_gnu64=no
CC_hpux_gnu64=gcc
LD_hpux_gnu64=gcc
ARCH_hpux_gnu64=
ARCH2_hpux_gnu64=64
ARCH3_hpux_gnu64=setup
LDOPTIONS_hpux_gnu64=-shared -mlp64 
PIC_hpux_gnu64=-fpic
COPTIONS_hpux_gnu64=-DHP -DHP64 -mlp64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2
COPTIONSZlib_hpux_gnu64=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_hpux_gnu64=-mlp64
FOPTIONS_hpux_gnu64=
FOPTIONSld_hpux_gnu64=
CURSESLIB_hpux_gnu64=-lcurses
SYSLIBSexe_hpux_gnu64=-lm -lc
SYSLIBSshr_hpux_gnu64=

#------------------------------------------------------------------------------
# Macros for Cygwin.
#------------------------------------------------------------------------------

SHARED_cygwin=yes
FOPTIONS_cygwin=-w
FOPTIONSld_cygwin=
SHAREDEXT_cygwin=dll
AROPTIONS_cygwin=rc
RANLIB_cygwin=yes
FC_cygwin=gfortran
EXEEXT_cygwin=.exe
JNIOS_cygwin=cygwin
JNIEXT_cygwin=dll

CURSES_cygwin_gnu=yes
CC_cygwin_gnu=gcc
LD_cygwin_gnu=gcc
ARCH_cygwin_gnu=1
ARCH2_cygwin_gnu=
ARCH3_cygwin_gnu=cygwin
LDOPTIONS_cygwin_gnu=-shared 
PIC_cygwin_gnu=
COPTIONS_cygwin_gnu=-I/usr/include/ncurses -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2 -Wno-stringop-overflow -Wno-attributes
COPTIONSZlib_cygwin_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_cygwin_gnu=
FOPTIONS_cygwin_gnu=-fsecond-underscore
FOPTIONSld_cygwin_gnu=
CURSESLIB_cygwin_gnu=-lncursesw
SYSLIBSexe_cygwin_gnu=-lgcc 
SYSLIBSshr_cygwin_gnu=-lgcc 

#------------------------------------------------------------------------------
# Macros for MinGW.
#------------------------------------------------------------------------------

SHARED_mingw=yes
FOPTIONS_mingw=-w
FOPTIONSld_mingw=
SHAREDEXT_mingw=dll
AROPTIONS_mingw=rc
RANLIB_mingw=yes
FC_mingw=gfortran
EXEEXT_mingw=.exe
JNIOS_mingw=mingw
JNIEXT_mingw=dll

CURSES_mingw_gnu=yes
CC_mingw_gnu=gcc
LD_mingw_gnu=gcc
ARCH_mingw_gnu=1
ARCH2_mingw_gnu=
ARCH3_mingw_gnu=cygwin
LDOPTIONS_mingw_gnu=-shared 
PIC_mingw_gnu=
COPTIONS_mingw_gnu=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -O2 -posix
COPTIONSZlib_mingw_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_mingw_gnu=
FOPTIONS_mingw_gnu=-fallow-argument-mismatch -fsecond-underscore
FOPTIONSld_mingw_gnu=
CURSESLIB_mingw_gnu=-lpdcurses
SYSLIBSexe_mingw_gnu=-lgcc
SYSLIBSshr_mingw_gnu=-lgcc

#------------------------------------------------------------------------------
# Macros for FreeBSD.
#------------------------------------------------------------------------------

SHARED_freebsd=yes
FOPTIONS_freebsd=-w
FOPTIONSld_freebsd=
SHAREDEXT_freebsd=so
AROPTIONS_freebsd=rc
RANLIB_freebsd=yes
FC_freebsd=f77
JNIOS_freebsd=freebsd
JNIEXT_freebsd=so

CURSES_freebsd_gnu=yes
CC_freebsd_gnu=gcc
LD_freebsd_gnu=gcc
ARCH_freebsd_gnu=
ARCH2_freebsd_gnu=
ARCH3_freebsd_gnu=setup
LDOPTIONS_freebsd_gnu=-shared
PIC_freebsd_gnu=-fPIC
COPTIONS_freebsd_gnu=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DMALLOC_CHECK_=0
COPTIONSZlib_freebsd_gnu=-DHAVE_STDARG_H -DHAVE_UNISTD_H
COPTIONSld_freebsd_gnu=
FOPTIONS_freebsd_gnu=
FOPTIONSld_freebsd_gnu=
CURSESLIB_freebsd_gnu=-lncurses
SYSLIBSexe_freebsd_gnu=-lm -lc
SYSLIBSshr_freebsd_gnu=-lm -lc

#------------------------------------------------------------------------------
# Miscellaneous Macros.
#------------------------------------------------------------------------------

AND.yes.yes=yes
AND.yes.no=no
AND.no.yes=no
AND.no.no=no

SUPPORTED.yes=supported
SUPPORTED.no=not supported

#------------------------------------------------------------------------------
# Compile/link entire distribution.
#------------------------------------------------------------------------------

all.help:
	@if `type -p more > /dev/null 2>&1` ; then \
	   more $(SRCDIR)/Help.all-classic ; \
	 else \
	   less $(SRCDIR)/Help.all-classic ; \
	 fi

all: all.$(OS).$(ENV)

all..:
	echo "Missing OS and ENV variables."

all.linux.gnu: all.build
all.linux.gnu32: all.build
all.linux.gnu64: all.build
all.linux.intel: note1.intel all.build
all.solaris.sparc: note1.noCC all.build
all.solaris.sparc64: note1.noCC all.build
all.solaris.gnu: all.build
all.solaris.gnu64: all.build
all.solaris.gnu64i: all.build
all.solaris.x86: all.build
all.solaris.x64: all.build
all.osf.dec: all.build
all.osf.gnu: all.build
all.cygwin.gnu: all.build
all.mingw.gnu: all.build
all.freebsd.gnu: all.build
all.macosx.gnu32: all.build
all.macosx.gnu: all.build
all.macosx.ppc: all.build
all.macosx.ppc64: all.build
all.macosx.i386:
	@if [ ${XCODEVERSION2} -gt 9 ] ; then \
	  $(MAKE) note1.macx.i386 ; \
	else \
	  $(MAKE) all.build ; \
	fi
all.macosx.x86_64: all.build
all.macosx.arm: all.build
all.macosx.arm64: all.build
all.macosx.arm32: all.build

all.build:
	@if [ "$(DIFFDIRS)" == "1" -a ! -d $(BLDzLIBsrcDIR) ] ; then \
	  mkdir -p $(BLDzLIBsrcDIR) $(BLDTOOLSsrcDIR) $(BLDTESTSsrcDIR) ; \
	  cp -p $(zLIBsrcDIR)/$(MAKEFILE) $(BLDzLIBsrcDIR) ; \
	  cp -p $(LIBsrcDIR)/$(MAKEFILE) $(BLDLIBsrcDIR) ; \
	  cp -p $(TOOLSsrcDIR)/$(MAKEFILE) $(BLDTOOLSsrcDIR) ; \
	  cp -p $(TESTSsrcDIR)/$(MAKEFILE) $(BLDTESTSsrcDIR) ; \
	fi
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_$(OS)_$(ENV))" \
"CCx=$(CC_$(OS)_$(ENV))" \
"COPTIONS=$(UCOPTIONS) $(COPTIONS_$(OS)_$(ENV)) $(COPTIONSZlib_$(OS)_$(ENV))" \
all 
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(AND.$(SHARED).$(SHARED_$(OS)))" \
"PIC=$(PIC_$(OS)_$(ENV))" \
"CCx=$(CC_$(OS)_$(ENV))" \
"LDx=$(LD_$(OS)_$(ENV))" \
"COPTIONS=$(UCOPTIONS) $(COPTIONS_$(OS)_$(ENV))" \
"SYSLIBS=$(SYSLIBSshr_$(OS)_$(ENV))" \
"SHAREDEXT=$(SHAREDEXT_$(OS))" \
"LDOPTIONS=$(LDOPTIONS_$(OS)_$(ENV))" \
"AROPTIONS=$(AROPTIONS_$(OS))" \
"RANLIB=$(RANLIB_$(OS))" \
"VERSION=$(VERSION)" \
"MAKEFILE=$(MAKEFILE)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_$(OS)_$(ENV))" \
"COPTIONS=$(COPTIONS_$(OS)_$(ENV))" \
"COPTIONSld=$(COPTIONSld_$(OS)_$(ENV))" \
"SYSLIBS=$(SYSLIBSexe_$(OS)_$(ENV))" \
"CURSESLIB=$(CURSESLIB_$(OS)_$(ENV))" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_$(OS))" \
"CCx=$(CC_$(OS)_$(ENV))" \
"SHARED=$(AND.$(SHARED).$(SHARED_$(OS)))" \
"FOPTIONS=$(FOPTIONS_$(OS)) $(FOPTIONS_$(OS)_$(ENV))" \
"FOPTIONSld=$(FOPTIONSld_$(OS)) $(FOPTIONSld_$(OS)_$(ENV))" \
"COPTIONS=$(COPTIONS_$(OS)_$(ENV))" \
"COPTIONSld=$(COPTIONSld_$(OS)_$(ENV))" \
"SYSLIBS=$(SYSLIBSexe_$(OS)_$(ENV))" \
"SHAREDEXT=$(SHAREDEXT_$(OS))" \
"MAKEFILE=$(MAKEFILE)" \
all
	@if [ "$(JNI)" == "yes" ] ; then \
	  if [ "$(JNI2)" == "yes" ] ; then \
	    $(MAKE) -f $(SRCDIR)/$(MAKEFILE) --no-print-directory MAKE=$(MAKE) JNIOS=$(JNIOS_$(OS)) JNIEXT=$(JNIEXT_$(OS)) JDK_HOME="$(JAVA_HOME)" build.jni ; \
	  else \
	    echo "*** JNI is not built as JDK or jni.h is not found..." ; \
	  fi \
	fi

build.jni:
	@if [ ! -d $(BLDJNIsrcDIR) ] ; then \
	  mkdir -p $(BLDJNIsrcDIR) ; \
	  cp -f $(JNIsrcDIR)/$(MAKEFILE) $(BLDJNIsrcDIR) ; \
	fi
	@cd $(JNIsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(JNIsrcDIR)" \
"BLDDIR=$(BLDJNIsrcDIR)" \
"SHARED=$(AND.$(SHARED).$(SHARED_$(OS)))" \
"PIC=$(PIC_$(OS)_$(ENV))" \
"CCx=$(CC_$(OS)_$(ENV))" \
"LDx=$(LD_$(OS)_$(ENV))" \
"COPTIONS=$(UCOPTIONS) $(COPTIONS_$(OS)_$(ENV))" \
"SYSLIBS=$(SYSLIBSshr_$(OS)_$(ENV))" \
"SHAREDEXT=$(SHAREDEXT_$(OS))" \
"LDOPTIONS=$(LDOPTIONS_$(OS)_$(ENV))" \
"VERSION=$(VERSION)" \
JAVA_HOME="$(JDK_HOME)" \
"JNIOS=$(JNIOS)" \
"JNIEXT=$(JNIEXT)" \
"LDLIB=$(LDLIB)" \
all

#------------------------------------------------------------------------------
# Test distribution.
#------------------------------------------------------------------------------

test.help:
	@if `type -p more > /dev/null 2>&1` ; then \
	   more $(SRCDIR)/Help.test-classic ; \
	 else \
	   less $(SRCDIR)/Help.test-classic ; \
	 fi

test:
	if [ ! -f $(BLDTESTSsrcDIR)/$(MAKEFILE) ] ; then \
	  cp -f $(TESTSsrcDIR)/$(MAKEFILE) $(BLDTESTSsrcDIR) ; \
	fi
	cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) BLDDIR=$(BLDTESTSsrcDIR) MAKE=$(MAKE) MAKEFILE=$(MAKEFILE) test 

#------------------------------------------------------------------------------
# Install files.
#------------------------------------------------------------------------------

install.help:
	@if `type -p more > /dev/null 2>&1` ; then \
	   more $(SRCDIR)/Help.install-classic ; \
	 else \
	   less $(SRCDIR)/Help.install-classic ; \
	 fi

install: install.$(PART)

install.all: install.definitions install.include install.lib \
	     install.tools install.help_ copy.leapseconds copy.txt \
	     install.jar notify.user

install.definitions: create.bin copy.definitions change.definitions
install.include: create.include copy.include
install.tools: create.bin copy.tools
install.jar: create.lib copy.jars
install.help_: create.help copy.help

install.lib: create.lib copy.lib.a
	@if [ -f $(BLDLIBsrcDIR)/libcdf.so ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.so ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDLIBsrcDIR)/libcdf.sl ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.sl ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDLIBsrcDIR)/libcdf.dylib ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.dylib ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.so ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.jnilib ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.jnilib ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.jnilib ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.dll ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.jnilib ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.sl ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.jnilib ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDLIBsrcDIR)/libcdf.o ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.o ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ -f $(BLDLIBsrcDIR)/libcdf.dll ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIRx)" install.lib.dll ; \
	 else \
	   $(NULL) ; \
	 fi

install.lib.so: create.lib copy.lib.so
install.lib.sl: create.lib copy.lib.sl
install.lib.dylib: create.lib copy.lib.dylib
install.lib.jnilib: create.lib copy.lib.jnilib
install.lib.o: create.lib copy.lib.o
install.lib.dll: create.lib copy.lib.dll

create.include:
	@if [ ! -d $(INSTALLDIRx)/include ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/include" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi

create.bin:
	@if [ ! -d $(INSTALLDIRx)/bin ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/bin" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi

create.lib:
	@if [ ! -d $(INSTALLDIRx)/lib ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/lib" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi

create.lib2:
	@if [ $(MACVERSION) -gt 0 ] ; then \
	  if [ ! -d $(MYHOME)/Library/Java/Extensions ] ; then \
	    $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(MYHOME)/Library/Java/Extensions" create.dir ; \
	  else \
	    $(NULL) ; \
	  fi \
	else \
	  $(NULL) ; \
	fi

create.help:
	@if [ ! -d $(INSTALLDIRx)/lib ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/lib" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ ! -d $(INSTALLDIRx)/lib/cdf ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/lib/cdf" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi
	@if [ ! -d $(INSTALLDIRx)/lib/cdf/help ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) "TARGET=$(INSTALLDIRx)/lib/cdf/help" create.dir ; \
	 else \
	   $(NULL) ; \
	 fi

change.definitions:
	@if [ $(INSTALLDIRx) == $(SRCDIR) ] ; then \
	   $(SHELL) $(SRCDIR)/modify_definition_files.sh $(SRCDIR) ; \
	else \
	   $(SHELL) $(SRCDIR)/modify_definition_files.sh $(INSTALLDIRx) ; \
	fi

copy.leapseconds:
	@if [ $(INSTALLDIRx) != $(SRCDIR) ] ; then \
	      cp -f $(SRCDIR)/CDFLeapSeconds.txt $(INSTALLDIRx) ; \
	fi

copy.txt:
	@if [ $(INSTALLDIRx) != $(SRCDIR) ] ; then \
	      cp -f $(SRCDIR)/CDF_copyright.txt $(INSTALLDIRx) ; \
	      cp -f $(SRCDIR)/CHANGES.txt $(INSTALLDIRx) ; \
	      cp -f $(SRCDIR)/Release_notes.txt $(INSTALLDIRx) ; \
	      cp -f $(SRCDIR)/Welcome.txt $(INSTALLDIRx) ; \
	      cp -f $(SRCDIR)/README_cdf_tools.txt $(INSTALLDIRx) ; \
	fi

copy.definitions:
	@mkdir -p $(INSTALLDIRx)/bin
	@echo cp -f $(DEFSsrcDIR)/definitions.C $(INSTALLDIRx)/bin
	      cp -f $(DEFSsrcDIR)/definitions.C $(INSTALLDIRx)/bin
	@echo cp -f $(DEFSsrcDIR)/definitions.K $(INSTALLDIRx)/bin
	      cp -f $(DEFSsrcDIR)/definitions.K $(INSTALLDIRx)/bin
	@echo cp -f $(DEFSsrcDIR)/definitions.B $(INSTALLDIRx)/bin
	      cp -f $(DEFSsrcDIR)/definitions.B $(INSTALLDIRx)/bin

copy.include:
	@mkdir -p $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdf.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdf.h $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdf.inc $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdf.inc $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdflib.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdflib.h $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdflib64.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdflib64.h $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdfdist.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdfdist.h $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdfconfig.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdfconfig.h $(INSTALLDIRx)/include
	@echo cp -f $(INCsrcDIR)/cdftools.h $(INSTALLDIRx)/include
	      cp -f $(INCsrcDIR)/cdftools.h $(INSTALLDIRx)/include

copy.lib.so:
	@mkdir -p $(INSTALLDIRx)/lib
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.so $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.so $(INSTALLDIRx)/lib/libcdf.$(VERSION).so
	      rm -f $(INSTALLDIRx)/lib/libcdf.so
	      cd $(INSTALLDIRx)/lib && ln -s libcdf.$(VERSION).so libcdf.so

copy.lib.sl:
	@mkdir -p $(INSTALLDIRx)/lib
	@if [ ! -d $(INSTALLDIRx)/lib ] ; then \
	  mkdir -p $(INSTALLDIRx)/lib ; \
	fi
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.sl $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.sl $(INSTALLDIRx)/lib/libcdf.$(VERSION).sl
	      rm -f $(INSTALLDIRx)/lib/libcdf.sl
	      cd $(INSTALLDIRx)/lib && ln -s libcdf.$(VERSION).sl libcdf.sl

copy.lib.dylib:
	@mkdir -p $(INSTALLDIRx)/lib
	@if [ ! -d $(INSTALLDIRx)/lib ] ; then \
	  mkdir -p $(INSTALLDIRx)/lib ; \
	fi
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.dylib $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.dylib $(INSTALLDIRx)/lib/libcdf.$(VERSION).dylib
	      rm -f $(INSTALLDIRx)/lib/libcdf.dylib
	      cd $(INSTALLDIRx)/lib && ln -s libcdf.$(VERSION).dylib libcdf.dylib

copy.lib.jnilib:
	@mkdir -p $(INSTALLDIRx)/lib
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.so ] ; then \
	  echo cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.so $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).so ; \
	  cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.so $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).so ; \
	  rm -f $(INSTALLDIRx)/lib/libcdfNativeLibrary.so ; \
	  cd $(INSTALLDIRx)/lib && ln -s libcdfNativeLibrary.$(VERSION).so libcdfNativeLibrary.so ; \
	fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.dll ] ; then \
	  echo cp -f $(JNIsrcDIR)/libcdfNativeLibrary.dll $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).dll ; \
	  cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.dll $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).dll ; \
	  rm -f $(INSTALLDIRx)/lib/libcdfNativeLibrary.dll ; \
	  cd $(INSTALLDIRx)/lib && ln -s libcdfNativeLibrary.$(VERSION).dll libcdfNativeLibrary.dll ; \
	fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.jnilib ] ; then \
	  echo cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.jnilib $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
	  cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.jnilib $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
	  rm -f $(INSTALLDIRx)/lib/libcdfNativeLibrary.jnilib ; \
	  cd $(INSTALLDIRx)/lib && ln -s libcdfNativeLibrary.$(VERSION).jnilib libcdfNativeLibrary.jnilib ; \
	fi
	@if [ -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.sl ] ; then \
	  echo cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.sl $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).sl ; \
	  cp -f $(BLDJNIsrcDIR)/libcdfNativeLibrary.sl $(INSTALLDIRx)/lib/libcdfNativeLibrary.$(VERSION).sl ; \
	  rm -f $(INSTALLDIRx)/lib/libcdfNativeLibrary.sl ; \
	  cd $(INSTALLDIRx)/lib && ln -s libcdfNativeLibrary.$(VERSION).sl libcdfNativeLibrary.sl ; \
	fi

copy.lib.o:
	@mkdir -p $(INSTALLDIRx)/lib
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.o $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.o $(INSTALLDIRx)/lib

copy.lib.dll:
	@mkdir -p $(INSTALLDIRx)/lib
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.dll $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.dll $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.dll $(INSTALLDIRx)/lib/libcdf.$(VERSION).dll
	      rm -f $(INSTALLDIRx)/lib/libcdf.dll
	      cd $(INSTALLDIRx)/lib && ln -s libcdf.$(VERSION).dll libcdf.dll

copy.lib.a:
	@mkdir -p $(INSTALLDIRx)/lib
	@echo cp -f $(BLDLIBsrcDIR)/libcdf.a $(INSTALLDIRx)/lib
	      cp -f $(BLDLIBsrcDIR)/libcdf.a $(INSTALLDIRx)/lib

copy.tools:
	@mkdir -p $(INSTALLDIRx)/bin
	@if [ -f $(BLDTOOLSsrcDIR)/cdfedit.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfedit.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfedit.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfedit ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfedit" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfedit" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfxp.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfxp.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfexport.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfxp ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfxp" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfexport" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfcvt.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfcvt.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfconvert.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfcvt ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfcvt" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfconvert" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/skt2cdf.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/skt2cdf.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/skeletoncdf.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/skt2cdf ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/skt2cdf" \
	        "DESTINATION=$(INSTALLDIRx)/bin/skeletoncdf" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdf2skt.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdf2skt.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/skeletontable.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdf2skt ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdf2skt" \
	        "DESTINATION=$(INSTALLDIRx)/bin/skeletontable" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfinq.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfinq.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfinquire.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfinq ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfinq" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfinquire" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfstats.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfstats.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfstats.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfstats ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfstats" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfstats" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfcmp.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfcmp.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfcompare.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfcmp ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfcmp" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfcompare" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfdump.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfdump.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfdump.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfdump ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfdump" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfdump" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfirsdump.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfirsdump.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfirsdump.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfirsdump ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfirsdump" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfirsdump" \
		copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfmerge.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfmerge.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfmerge.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfmerge ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfmerge" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfmerge" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfvalidate.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfvalidate.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfvalidate.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfvalidate ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfvalidate" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfvalidate" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/cdfleapsecondsinfo.exe ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
		"SOURCE=$(BLDTOOLSsrcDIR)/cdfleapsecondsinfo.exe" \
		"DESTINATION=$(INSTALLDIRx)/bin/cdfleapsecondsinfo.exe" \
		copy.file ; \
	elif [ -f $(BLDTOOLSsrcDIR)/cdfleapsecondsinfo ] ; then \
	   $(MAKE) $(EXTRAMAKE1) MAKE=$(MAKE) \
	        "SOURCE=$(BLDTOOLSsrcDIR)/cdfleapsecondsinfo" \
	        "DESTINATION=$(INSTALLDIRx)/bin/cdfleapsecondsinfo" \
	        copy.file ; \
	else \
	   $(NULL) ; \
	fi
	@echo cp -f $(TOOLSsrcDIR)/cdfdir.unix $(INSTALLDIRx)/bin/cdfdir
	      cp -f $(TOOLSsrcDIR)/cdfdir.unix $(INSTALLDIRx)/bin/cdfdir

copy.help:
	@mkdir -p $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfedit.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfedit.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfeditj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfeditj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfedit.ilh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfedit.ilh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfbrow.ilh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfbrow.ilh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfxp.ilh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfxp.ilh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfcvt.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfcvt.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfcvtj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfcvtj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfcmp.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfcmp.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfcmpj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfcmpj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdf2skt.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdf2skt.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdf2sktj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdf2sktj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/skt2cdf.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/skt2cdf.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/skt2cdfj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/skt2cdfj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfstats.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfstats.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfstatsj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfstatsj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfdump.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfdump.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfdumpj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfdumpj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfirsdump.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfirsdump.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfirsdumpj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfirsdumpj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfinq.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfinq.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfinqj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfinqj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfdirj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfdirj.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfmerge.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfmerge.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfmergej.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfmergej.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfvalidate.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfvalidate.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfvalidatej.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfvalidatej.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfleaptableinfo.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfleaptableinfo.olh $(INSTALLDIRx)/lib/cdf/help
	@echo cp -f $(HELPsrcDIR)/cdfleaptableinfoj.olh $(INSTALLDIRx)/lib/cdf/help
	      cp -f $(HELPsrcDIR)/cdfleaptableinfoj.olh $(INSTALLDIRx)/lib/cdf/help

copy.jars:
	@mkdir -p $(INSTALLDIRx)/lib
	@if [ -f $(BLDJNIsrcDIR)/cdfNativeLibrary.o ] ; then \
	  echo cp -f $(SRCDIR)/cdfjava/classes/cdfjava.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/classes/cdfjava.jar $(INSTALLDIRx)/lib ; \
	  echo cp -f $(SRCDIR)/cdfjava/classes/cdfjson.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/classes/cdfjson.jar $(INSTALLDIRx)/lib ; \
	  echo cp -f $(SRCDIR)/cdfjava/classes/cdfml.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/classes/cdfml.jar $(INSTALLDIRx)/lib ; \
	  echo cp -f $(SRCDIR)/cdfjava/classes/gson-2.8.6.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/classes/gson-2.8.6.jar $(INSTALLDIRx)/lib ; \
	  echo cp -f $(SRCDIR)/cdfjava/classes/javax.json-1.0.4.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/classes/javax.json-1.0.4.jar $(INSTALLDIRx)/lib ; \
	  echo cp -f $(SRCDIR)/cdfjava/cdftools/CDFToolsDriver.jar $(INSTALLDIRx)/lib ; \
	       cp -f $(SRCDIR)/cdfjava/cdftools/CDFToolsDriver.jar $(INSTALLDIRx)/lib ; \
	  cp -f $(SRCDIR)/HOWTO_run-CDF-Java-tools.txt $(INSTALLDIRx) ; \
	  cp -f $(SRCDIR)/HOWTO_run-CDF-Json-tools.txt $(INSTALLDIRx) ; \
	  cp -f $(SRCDIR)/HOWTO_run-CDF-XML-tools.txt $(INSTALLDIRx) ; \
	else \
	  $(NULL) ; \
	fi

create.dir:
	@echo mkdir -p $(TARGET)
	      mkdir -p $(TARGET)

copy.file:
	@echo cp -f $(SOURCE) $(DESTINATION)
	      cp -f $(SOURCE) $(DESTINATION)
	      chmod +x $(DESTINATION)

dylibbundler.file:
	@echo install_name_tool -change $(SRCLIB)/libcdf.dylib "@executable_path/../lib/libcdf.dylib" "$(SOURCE)"
	install_name_tool -change $(SRCLIB)/libcdf.dylib "@executable_path/../lib/libcdf.dylib" "$(SOURCE)"

notify.user:
	@echo
	@echo Installation completed!
	@echo
	@echo "**********"
	@echo "*  NOTE  *"
	@echo "**********"
	@echo "If you want to use any of the CDF command-line utilitites (e.g. cdfedit, "
	@echo "cdfexport, etc.), we strongly encourage you to set the CDF environment "
	@echo "variables defined in the CDF definition files.  Once the environment variables"
	@echo "defined, you can invoke the CDF utility of interest just by typing the utility"
	@echo "name. Otherwise, you'll have to specify the full path of the utility."
	@echo
	@echo If you use TCSH or CSH, run the following command:
	@echo
	@if [ $(INSTALLDIRx) == $(BLDDIR) ] ; then \
	   echo "    source `pwd`/bin/definitions.C" ; \
	else \
	   echo "    source $(INSTALLDIRx)/bin/definitions.C" ; \
	fi
	@echo
	@echo
	@echo If you use BASH/BSH and ZSH, run the following command: 
	@echo
	@if [ $(INSTALLDIRx) == $(BLDDIR) ] ; then \
	   echo "    . `pwd`/bin/definitions.B" ; \
	else \
	   echo "    . $(INSTALLDIRx)/bin/definitions.B" ; \
	fi
	@echo
	@echo
	@echo If you use KSH, run the following command: 
	@echo
	@if [ $(INSTALLDIRx) == $(BLDDIR) ] ; then \
	   echo "    . `pwd`/bin/definitions.K" ; \
	else \
	   echo "    . $(INSTALLDIRx)/bin/definitions.K" ; \
	fi
	@echo
	@echo

ranlib.file:
	@echo $(RANLIB) $(TARGET)
	      $(RANLIB) $(TARGET)

#------------------------------------------------------------------------------
# Clean/purge.
#------------------------------------------------------------------------------

clean:
	@-rm -f $(SRCDIR)/core
	@-rm -f $(SRCDIR)/samples/core
	@if [ -f $(BLDzLIBsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDzLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(zLIBsrcDIR) BLDDIR=$(BLDzLIBsrcDIR) MAKE=$(MAKE) clean ; \
	fi
	@if [ -f $(BLDLIBsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(LIBsrcDIR) BLDDIR=$(BLDLIBsrcDIR) MAKE=$(MAKE) clean ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDTOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(TOOLSsrcDIR) BLDDIR=$(BLDTOOLSsrcDIR) MAKE=$(MAKE) clean ; \
	fi
	@if [ -f $(BLDTESTSsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDTESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(TESTSsrcDIR) BLDDIR=$(BLDTESTSsrcDIR) MAKE=$(MAKE) clean ; \
	fi
	@if [ -f $(BLDJNIsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDJNIsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(JNIsrcDIR) BLDDIR=$(BLDJNIsrcDIR) MAKE=$(MAKE) clean ; \
	fi

purge:
	@-rm -f $(SRCDIR)/*~
	@-rm -f $(SRCDIR)/*#
	@-rm -f $(SRCDIR)/samples/*~
	@-rm -f $(SRCDIR)/samples/*#
	@-rm -f $(HELPsrcDIR)/*~
	@-rm -f $(HELPsrcDIR)/*#
	@-rm -f $(DEFSsrcDIR)/*~
	@-rm -f $(DEFSsrcDIR)/*#
	@-rm -f $(INCsrcDIR)/*~
	@-rm -f $(INCsrcDIR)/*#
	@if [ -f $(BLDzLIBsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDzLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(zLIBsrcDIR) BLDDIR=$(BLDzLIBsrcDIR) MAKE=$(MAKE) purge ; \
	fi
	@if [ -f $(BLDLIBsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(LIBsrcDIR) BLDDIR=$(BLDLIBsrcDIR) MAKE=$(MAKE) purge ; \
	fi
	@if [ -f $(BLDTOOLSsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDTOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(TOOLSsrcDIR) BLDDIR=$(BLDTOOLSsrcDIR) MAKE=$(MAKE) purge ; \
	fi
	@if [ -f $(BLDTESTsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDTESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(TESTSsrcDIR) BLDDIR=$(BLDTESTSsrcDIR) MAKE=$(MAKE) purge ; \
	fi
	@if [ -f $(BLDJNIsrcDIR)/$(MAKEFILE) ] ; then \
	  cd $(BLDJNIsrcDIR); $(MAKE) $(EXTRAMAKE2) SRCDIR=$(JNIsrcDIR) BLDDIR=$(BLDJNIsrcDIR) MAKE=$(MAKE) purge ; \
	fi

#------------------------------------------------------------------------------
# Ultrix.
#------------------------------------------------------------------------------

all.ultrix.risc: note1.all.ultrix.risc.build
all.ultrix.gnu: note1.1st all.ultrix.gnu.build

all.ultrix.risc.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_ultrix_risc)" \
"CCx=$(CC_ultrix_risc)" \
"COPTIONS=$(COPTIONS_ultrix_risc)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_ultrix)" \
"PIC=$(PIC_ultrix_risc)" \
"CCx=$(CC_ultrix_risc)" \
"LDx=$(LD_ultrix_risc)" \
"COPTIONS=$(COPTIONS_ultrix_risc)" \
"SYSLIBS=$(SYSLIBSshr_ultrix_risc)" \
"SHAREDEXT=$(SHAREDEXT_ultrix)" \
"LDOPTIONS=$(LDOPTIONS_ultrix_risc)" \
"AROPTIONS=$(AROPTIONS_ultrix)" \
"RANLIB=$(RANLIB_ultrix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_ultrix_risc)" \
"COPTIONS=$(COPTIONS_ultrix_risc)" \
"COPTIONSld=$(COPTIONSld_ultrix_risc)" \
"SYSLIBS=$(SYSLIBSexe_ultrix_risc)" \
"CURSESLIB=$(CURSESLIB_ultrix_risc)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_ultrix)" \
"CCx=$(CC_ultrix_risc)" \
"SHARED=$(SHARED_ultrix)" \
"FOPTIONS=$(FOPTIONS_ultrix)" \
"FOPTIONSld=$(FOPTIONSld_ultrix)" \
"COPTIONS=$(COPTIONS_ultrix_risc)" \
"COPTIONSld=$(COPTIONSld_ultrix_risc)" \
"SYSLIBS=$(SYSLIBSexe_ultrix_risc)" \
"SHAREDEXT=$(SHAREDEXT_ultrix)" \
all

all.ultrix.gnu.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_ultrix_gnu)" \
"CCx=$(CC_ultrix_gnu)" \
"COPTIONS=$(COPTIONS_ultrix_gnu)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_ultrix)" \
"PIC=$(PIC_ultrix_gnu)" \
"CCx=$(CC_ultrix_gnu)" \
"LDx=$(LD_ultrix_gnu)" \
"COPTIONS=$(COPTIONS_ultrix_gnu)" \
"SYSLIBS=$(SYSLIBSshr_ultrix_gnu)" \
"SHAREDEXT=$(SHAREDEXT_ultrix)" \
"LDOPTIONS=$(LDOPTIONS_ultrix_gnu)" \
"AROPTIONS=$(AROPTIONS_ultrix)" \
"RANLIB=$(RANLIB_ultrix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_ultrix_gnu)" \
"COPTIONS=$(COPTIONS_ultrix_gnu)" \
"COPTIONSld=$(COPTIONSld_ultrix_gnu)" \
"SYSLIBS=$(SYSLIBSexe_ultrix_gnu)" \
"CURSESLIB=$(CURSESLIB_ultrix_gnu)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_ultrix)" \
"CCx=$(CC_ultrix_gnu)" \
"SHARED=$(SHARED_ultrix)" \
"FOPTIONS=$(FOPTIONS_ultrix)" \
"FOPTIONSld=$(FOPTIONSld_ultrix)" \
"COPTIONS=$(COPTIONS_ultrix_gnu)" \
"COPTIONSld=$(COPTIONSld_ultrix_gnu)" \
"SYSLIBS=$(SYSLIBSexe_ultrix_gnu)" \
"SHAREDEXT=$(SHAREDEXT_ultrix)" \
all

#------------------------------------------------------------------------------
# HP-UX.
#------------------------------------------------------------------------------

all.hpux.gnu: all.hpux.gnu.build
all.hpux.opt: all.hpux.opt.build
all.hpux.gnu64: all.hpux.gnu64.build
all.hpux.opt64: all.hpux.opt64.build

all.hpux.std.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_std)" \
"CCx=$(CC_hpux_std)" \
"COPTIONS=$(COPTIONS_hpux_std) $(COPTIONSZlib_hpux_std)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_hpux_std)" \
"PIC=$(PIC_hpux_std)" \
"CCx=$(CC_hpux_std)" \
"LDx=$(LD_hpux_std)" \
"COPTIONS=$(COPTIONS_hpux_std)" \
"SYSLIBS=$(SYSLIBSshr_hpux_std)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_std)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_std)" \
"COPTIONS=$(COPTIONS_hpux_std)" \
"COPTIONSld=$(COPTIONSld_hpux_std)" \
"SYSLIBS=$(SYSLIBSexe_hpux_std)" \
"CURSESLIB=$(CURSESLIB_hpux_std)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_std)" \
"SHARED=$(SHARED_hpux_std)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_std)" \
"COPTIONSld=$(COPTIONSld_hpux_std)" \
"SYSLIBS=$(SYSLIBSexe_hpux_std)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all

all.hpux.opt.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_opt)" \
"CCx=$(CC_hpux_opt)" \
"COPTIONS=$(COPTIONS_hpux_opt) $(COPTIONSZlib_hpux_opt)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_hpux_opt)" \
"CCx=$(CC_hpux_opt)" \
"LDx=$(LD_hpux_opt)" \
"COPTIONS=$(COPTIONS_hpux_opt)" \
"SYSLIBS=$(SYSLIBSshr_hpux_opt)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_opt)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_opt)" \
"COPTIONS=$(COPTIONS_hpux_opt)" \
"COPTIONSld=$(COPTIONSld_hpux_opt)" \
"SYSLIBS=$(SYSLIBSexe_hpux_opt)" \
"CURSESLIB=$(CURSESLIB_hpux_opt)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_opt)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_opt)" \
"COPTIONSld=$(COPTIONSld_hpux_opt)" \
"SYSLIBS=$(SYSLIBSexe_hpux_opt)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all

all.hpux.opt64.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_opt64)" \
"CCx=$(CC_hpux_opt64)" \
"COPTIONS=$(COPTIONS_hpux_opt64) $(COPTIONSZlib_hpux_opt64)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_hpux_opt64)" \
"CCx=$(CC_hpux_opt64)" \
"LDx=$(LD_hpux_opt64)" \
"COPTIONS=$(COPTIONS_hpux_opt64)" \
"SYSLIBS=$(SYSLIBSshr_hpux_opt64)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_opt64)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_opt64)" \
"COPTIONS=$(COPTIONS_hpux_opt64)" \
"COPTIONSld=$(COPTIONSld_hpux_opt64)" \
"SYSLIBS=$(SYSLIBSexe_hpux_opt64)" \
"CURSESLIB=$(CURSESLIB_hpux_opt64)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_opt64)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_opt64)" \
"COPTIONSld=$(COPTIONSld_hpux_opt64)" \
"SYSLIBS=$(SYSLIBSexe_hpux_opt64)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all

all.hpux.posix.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_posix)" \
"CCx=$(CC_hpux_posix)" \
"COPTIONS=$(COPTIONS_hpux_posix) $(COPTIONSZlib_hpux_posix)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_hpux_posix)" \
"CCx=$(CC_hpux_posix)" \
"LDx=$(LD_hpux_posix)" \
"COPTIONS=$(COPTIONS_hpux_posix)" \
"SYSLIBS=$(SYSLIBSshr_hpux_posix)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_posix)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_posix)" \
"COPTIONS=$(COPTIONS_hpux_posix)" \
"COPTIONSld=$(COPTIONSld_hpux_posix)" \
"SYSLIBS=$(SYSLIBSexe_hpux_posix)" \
"CURSESLIB=$(CURSESLIB_hpux_posix)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_posix)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_posix)" \
"COPTIONSld=$(COPTIONSld_hpux_posix)" \
"SYSLIBS=$(SYSLIBSexe_hpux_posix)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all

all.hpux.gnu.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_gnu)" \
"CCx=$(CC_hpux_gnu)" \
"COPTIONS=$(COPTIONS_hpux_gnu) $(COPTIONSZlib_hpux_gnu)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_hpux_gnu)" \
"CCx=$(CC_hpux_gnu)" \
"LDx=$(LD_hpux_gnu)" \
"COPTIONS=$(COPTIONS_hpux_gnu)" \
"SYSLIBS=$(SYSLIBSshr_hpux_gnu)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_gnu)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_gnu)" \
"COPTIONS=$(COPTIONS_hpux_gnu)" \
"COPTIONSld=$(COPTIONSld_hpux_gnu)" \
"SYSLIBS=$(SYSLIBSexe_hpux_gnu)" \
"CURSESLIB=$(CURSESLIB_hpux_gnu)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_gnu)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_gnu)" \
"COPTIONSld=$(COPTIONSld_hpux_gnu)" \
"SYSLIBS=$(SYSLIBSexe_hpux_gnu)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all

all.hpux.gnu64.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_hpux_gnu64)" \
"CCx=$(CC_hpux_gnu64)" \
"COPTIONS=$(COPTIONS_hpux_gnu64) $(COPTIONSZlib_hpux_gnu64)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_hpux_gnu64)" \
"CCx=$(CC_hpux_gnu64)" \
"LDx=$(LD_hpux_gnu64)" \
"COPTIONS=$(COPTIONS_hpux_gnu64)" \
"SYSLIBS=$(SYSLIBSshr_hpux_gnu64)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
"LDOPTIONS=$(LDOPTIONS_hpux_gnu64)" \
"AROPTIONS=$(AROPTIONS_hpux)" \
"RANLIB=$(RANLIB_hpux)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_hpux_gnu64)" \
"COPTIONS=$(COPTIONS_hpux_gnu64)" \
"COPTIONSld=$(COPTIONSld_hpux_gnu64)" \
"SYSLIBS=$(SYSLIBSexe_hpux_gnu64)" \
"CURSESLIB=$(CURSESLIB_hpux_gnu64)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_hpux)" \
"CCx=$(CC_hpux_gnu64)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_hpux)" \
"FOPTIONSld=$(FOPTIONSld_hpux)" \
"COPTIONS=$(COPTIONS_hpux_gnu64)" \
"COPTIONSld=$(COPTIONSld_hpux_gnu64)" \
"SYSLIBS=$(SYSLIBSexe_hpux_gnu64)" \
"SHAREDEXT=$(SHAREDEXT_hpux)" \
all
#------------------------------------------------------------------------------
# IRIX 6.x.
#------------------------------------------------------------------------------

all.irix6.sgin32: all.irix6.sgin32.build
all.irix6.sgi64: all.irix6.sgi64.build
all.irix6.gnu: note1.1st all.irix6.gnu.build

all.irix6.sgin32.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_irix6_sgin32)" \
"CCx=$(CC_irix6_sgin32)" \
"COPTIONS=$(COPTIONS_irix6_sgin32) $(COPTIONSZlib_irix6_sgin32)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_irix6_sgin32)" \
"CCx=$(CC_irix6_sgin32)" \
"LDx=$(LD_irix6_sgin32)" \
"COPTIONS=$(COPTIONS_irix6_sgin32)" \
"SYSLIBS=$(SYSLIBSshr_irix6_sgin32)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
"LDOPTIONS=$(LDOPTIONS_irix6_sgin32) -n32" \
"AROPTIONS=$(AROPTIONS_irix6)" \
"RANLIB=$(RANLIB_irix6)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_irix6_sgin32)" \
"COPTIONS=$(COPTIONS_irix6_sgin32)" \
"COPTIONSld=$(COPTIONSld_irix6_sgin32)" \
"SYSLIBS=$(SYSLIBSexe_irix6_sgin32)" \
"CURSESLIB=$(CURSESLIB_irix6_sgin32)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_irix6)" \
"CCx=$(CC_irix6_sgin32)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_irix6)" \
"FOPTIONSld=$(FOPTIONSld_irix6)" \
"COPTIONS=$(COPTIONS_irix6_sgin32)" \
"COPTIONSld=$(COPTIONSld_irix6_sgin32)" \
"SYSLIBS=$(SYSLIBSexe_irix6_sgin32)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
all

all.irix6.sgi64.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_irix6_sgi64)" \
"CCx=$(CC_irix6_sgi64)" \
"COPTIONS=$(COPTIONS_irix6_sgi64) $(COPTIONSZlib_irix6_sgi64)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_irix6_sgi64)" \
"CCx=$(CC_irix6_sgi64)" \
"LDx=$(LD_irix6_sgi64)" \
"COPTIONS=$(COPTIONS_irix6_sgi64)" \
"SYSLIBS=$(SYSLIBSshr_irix6_sgi64)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
"LDOPTIONS=$(LDOPTIONS_irix6_sgi64) -64" \
"AROPTIONS=$(AROPTIONS_irix6)" \
"RANLIB=$(RANLIB_irix6)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_irix6_sgi64)" \
"COPTIONS=$(COPTIONS_irix6_sgi64)" \
"COPTIONSld=$(COPTIONSld_irix6_sgi64)" \
"SYSLIBS=$(SYSLIBSexe_irix6_sgi64)" \
"CURSESLIB=$(CURSESLIB_irix6_sgi64)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_irix6)" \
"CCx=$(CC_irix6_sgi64)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_irix6)" \
"FOPTIONSld=$(FOPTIONSld_irix6)" \
"COPTIONS=$(COPTIONS_irix6_sgi64)" \
"COPTIONSld=$(COPTIONSld_irix6_sgi64)" \
"SYSLIBS=$(SYSLIBSexe_irix6_sgi64)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
all

all.irix6.gnu.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_irix6_gnu)" \
"CCx=$(CC_irix6_gnu)" \
"COPTIONS=$(COPTIONS_irix6_gnu) $(COPTIONSZlib_irix6_gnu)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_irix6_gnu)" \
"CCx=$(CC_irix6_gnu)" \
"LDx=$(LD_irix6_gnu)" \
"COPTIONS=$(COPTIONS_irix6_gnu)" \
"SYSLIBS=$(SYSLIBSshr_irix6_gnu)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
"LDOPTIONS=$(LDOPTIONS_irix6_gnu) -n32" \
"AROPTIONS=$(AROPTIONS_irix6)" \
"RANLIB=$(RANLIB_irix6)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_irix6_gnu)" \
"COPTIONS=$(COPTIONS_irix6_gnu)" \
"COPTIONSld=$(COPTIONSld_irix6_gnu)" \
"SYSLIBS=$(SYSLIBSexe_irix6_gnu)" \
"CURSESLIB=$(CURSESLIB_irix6_gnu)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_irix6)" \
"CCx=$(CC_irix6_gnu)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_irix6)" \
"FOPTIONSld=$(FOPTIONSld_irix6)" \
"COPTIONS=$(COPTIONS_irix6_gnu)" \
"COPTIONSld=$(COPTIONSld_irix6_gnu)" \
"SYSLIBS=$(SYSLIBSexe_irix6_gnu)" \
"SHAREDEXT=$(SHAREDEXT_irix6)" \
all

#------------------------------------------------------------------------------
# AIX.
#------------------------------------------------------------------------------

all.aix.ibm: all.aix.ibm.build
all.aix.gnu: all.aix.gnu.build
all.aix.ibm64: all.aix.ibm64.build
all.aix.gnu64: all.aix.gnu64.build

all.aix.ibm.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_aix_ibm)" \
"CCx=$(CC_aix_ibm)" \
"COPTIONS=$(COPTIONS_aix_ibm) $(COPTIONSZlib_aix_ibm)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_aix_ibm)" \
"CCx=$(CC_aix_ibm)" \
"LDx=$(LD_aix_ibm)" \
"COPTIONS=$(COPTIONS_aix_ibm)" \
"SYSLIBS=$(SYSLIBSshr_aix_ibm)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
"LDOPTIONS=$(LDOPTIONS_aix_ibm)" \
"AROPTIONS=$(AROPTIONS_aix)" \
"RANLIB=$(RANLIB_aix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_aix_ibm)" \
"COPTIONS=$(COPTIONS_aix_ibm)" \
"COPTIONSld=$(COPTIONSld_aix_ibm)" \
"SYSLIBS=$(SYSLIBSexe_aix_ibm)" \
"CURSESLIB=$(CURSESLIB_aix_ibm)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_aix)" \
"CCx=$(CC_aix_ibm)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_aix)" \
"FOPTIONSld=$(FOPTIONSld_aix)" \
"COPTIONS=$(COPTIONS_aix_ibm)" \
"COPTIONSld=$(COPTIONSld_aix_ibm)" \
"SYSLIBS=$(SYSLIBSexe_aix_ibm)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
all

all.aix.gnu.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_aix_gnu)" \
"CCx=$(CC_aix_gnu)" \
"COPTIONS=$(COPTIONS_aix_gnu)  $(COPTIONSZlib_aix_gnu)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_aix_gnu)" \
"CCx=$(CC_aix_gnu)" \
"LDx=$(LD_aix_gnu)" \
"COPTIONS=$(COPTIONS_aix_gnu)" \
"SYSLIBS=$(SYSLIBSshr_aix_gnu)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
"LDOPTIONS=$(LDOPTIONS_aix_gnu)" \
"AROPTIONS=$(AROPTIONS_aix)" \
"RANLIB=$(RANLIB_aix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_aix_gnu)" \
"COPTIONS=$(COPTIONS_aix_gnu)" \
"COPTIONSld=$(COPTIONSld_aix_gnu)" \
"SYSLIBS=$(SYSLIBSexe_aix_gnu)" \
"CURSESLIB=$(CURSESLIB_aix_gnu)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_aix)" \
"CCx=$(CC_aix_gnu)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_aix)" \
"FOPTIONSld=$(FOPTIONSld_aix)" \
"COPTIONS=$(COPTIONS_aix_gnu)" \
"COPTIONSld=$(COPTIONSld_aix_gnu)" \
"SYSLIBS=$(SYSLIBSexe_aix_gnu)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
all

all.aix.ibm64.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_aix_ibm64)" \
"CCx=$(CC_aix_ibm64)" \
"COPTIONS=$(COPTIONS_aix_ibm64) $(COPTIONSZlib_aix_ibm64)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_aix_ibm64)" \
"CCx=$(CC_aix_ibm64)" \
"LDx=$(LD_aix_ibm64)" \
"COPTIONS=$(COPTIONS_aix_ibm64)" \
"SYSLIBS=$(SYSLIBSshr_aix_ibm64)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
"LDOPTIONS=$(LDOPTIONS_aix_ibm64)" \
"AROPTIONS=$(AROPTIONS_aix64)" \
"RANLIB=$(RANLIB_aix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_aix_ibm64)" \
"COPTIONS=$(COPTIONS_aix_ibm64)" \
"COPTIONSld=$(COPTIONSld_aix_ibm64)" \
"SYSLIBS=$(SYSLIBSexe_aix_ibm64)" \
"CURSESLIB=$(CURSESLIB_aix_ibm64)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_aix)" \
"CCx=$(CC_aix_ibm64)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_aix)" \
"FOPTIONSld=$(FOPTIONSld_aix)" \
"COPTIONS=$(COPTIONS_aix_ibm64)" \
"COPTIONSld=$(COPTIONSld_aix_ibm64)" \
"SYSLIBS=$(SYSLIBSexe_aix_ibm64)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
all

all.aix.gnu64.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_aix_gnu64)" \
"CCx=$(CC_aix_gnu64)" \
"COPTIONS=$(COPTIONS_aix_gnu64) $(COPTIONSZlib_aix_gnu64)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED)" \
"PIC=$(PIC_aix_gnu64)" \
"CCx=$(CC_aix_gnu64)" \
"LDx=$(LD_aix_gnu64)" \
"COPTIONS=$(COPTIONS_aix_gnu64)" \
"SYSLIBS=$(SYSLIBSshr_aix_gnu64)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
"LDOPTIONS=$(LDOPTIONS_aix_gnu64)" \
"AROPTIONS=$(AROPTIONS_aix64)" \
"RANLIB=$(RANLIB_aix)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(AND.$(CURSES).$(CURSES_$(OS)_$(ENV)))" \
"CCx=$(CC_aix_gnu64)" \
"COPTIONS=$(COPTIONS_aix_gnu64)" \
"COPTIONSld=$(COPTIONSld_aix_gnu64)" \
"SYSLIBS=$(SYSLIBSexe_aix_gnu64)" \
"CURSESLIB=$(CURSESLIB_aix_gnu64)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \

"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_aix)" \
"CCx=$(CC_aix_gnu64)" \
"SHARED=$(SHARED)" \
"FOPTIONS=$(FOPTIONS_aix)" \
"FOPTIONSld=$(FOPTIONSld_aix)" \
"COPTIONS=$(COPTIONS_aix_gnu64)" \
"COPTIONSld=$(COPTIONSld_aix_gnu64)" \
"SYSLIBS=$(SYSLIBSexe_aix_gnu64)" \
"SHAREDEXT=$(SHAREDEXT_aix)" \
all

#------------------------------------------------------------------------------
# Mach.
#------------------------------------------------------------------------------

all.mach.next: note1.1st all.mach.next.build
all.mach.macosx: all.mach.macosx.build 
all.mach.gnu: note1.1st all.mach.gnu.build

all.mach.next.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_mach_next)" \
"CCx=$(CC_mach_next)" \
"COPTIONS=$(COPTIONS_mach_next)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_mach)" \
"PIC=$(PIC_mach_next)" \
"CCx=$(CC_mach_next)" \
"LDx=$(LD_mach_next)" \
"COPTIONS=$(COPTIONS_mach_next)" \
"SYSLIBS=$(SYSLIBSshr_mach_next)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
"LDOPTIONS=$(LDOPTIONS_mach_next)" \
"AROPTIONS=$(AROPTIONS_mach)" \
"RANLIB=$(RANLIB_mach)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(CURSES_mach_next)" \
"CCx=$(CC_mach_next)" \
"COPTIONS=$(COPTIONS_mach_next)" \
"COPTIONSld=$(COPTIONSld_mach_next)" \
"SYSLIBS=$(SYSLIBSexe_mach_next)" \
"CURSESLIB=$(CURSESLIB_mach_next)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_mach)" \
"CCx=$(CC_mach_next)" \
"SHARED=$(SHARED_mach)" \
"FOPTIONS=$(FOPTIONS_mach)" \
"FOPTIONSld=$(FOPTIONSld_mach)" \
"COPTIONS=$(COPTIONS_mach_next)" \
"COPTIONSld=$(COPTIONSld_mach_next)" \
"SYSLIBS=$(SYSLIBSexe_mach_next)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
all

all.mach.macosx.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_mach_macosx)" \
"CCx=$(CC_mach_macosx)" \
"COPTIONS=$(COPTIONS_mach_macosx)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_mach)" \
"PIC=$(PIC_mach_macosx)" \
"CCx=$(CC_mach_macosx)" \
"LDx=$(LD_mach_macosx)" \
"COPTIONS=$(COPTIONS_mach_macosx)" \
"SYSLIBS=$(SYSLIBSshr_mach_macosx)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
"LDOPTIONS=$(LDOPTIONS_mach_macosx)" \
"AROPTIONS=$(AROPTIONS_mach)" \
"RANLIB=$(RANLIB_mach)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(CURSES_mach_macosx)" \
"CCx=$(CC_mach_macosx)" \
"COPTIONS=$(COPTIONS_mach_macosx)" \
"COPTIONSld=$(COPTIONSld_mach_macosx)" \
"SYSLIBS=$(SYSLIBSexe_mach_macosx)" \
"CURSESLIB=$(CURSESLIB_mach_macosx)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_mach)" \
"CCx=$(CC_mach_macosx)" \
"SHARED=$(SHARED_mach)" \
"FOPTIONS=$(FOPTIONS_mach)" \
"FOPTIONSld=$(FOPTIONSld_mach)" \
"COPTIONS=$(COPTIONS_mach_macosx)" \
"COPTIONSld=$(COPTIONSld_mach_macosx)" \
"SYSLIBS=$(SYSLIBSexe_mach_macosx)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
all

all.mach.gnu.build:
	@cd $(zLIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(zLIBsrcDIR)" \
"BLDDIR=$(BLDzLIBsrcDIR)" \
"PIC=$(PIC_mach_gnu)" \
"CCx=$(CC_mach_gnu)" \
"COPTIONS=$(COPTIONS_mach_gnu)" \
all
	@cd $(LIBsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(LIBsrcDIR)" \
"BLDDIR=$(BLDLIBsrcDIR)" \
"SHARED=$(SHARED_mach)" \
"PIC=$(PIC_mach_gnu)" \
"CCx=$(CC_mach_gnu)" \
"LDx=$(LD_mach_gnu)" \
"COPTIONS=$(COPTIONS_mach_gnu)" \
"SYSLIBS=$(SYSLIBSshr_mach_gnu)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
"LDOPTIONS=$(LDOPTIONS_mach_gnu)" \
"AROPTIONS=$(AROPTIONS_mach)" \
"RANLIB=$(RANLIB_mach)" \
all
	@cd $(TOOLSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TOOLSsrcDIR)" \
"BLDDIR=$(BLDTOOLSsrcDIR)" \
"CURSES=$(CURSES_mach_gnu)" \
"CCx=$(CC_mach_gnu)" \
"COPTIONS=$(COPTIONS_mach_gnu)" \
"COPTIONSld=$(COPTIONSld_mach_gnu)" \
"SYSLIBS=$(SYSLIBSexe_mach_gnu)" \
"CURSESLIB=$(CURSESLIB_mach_gnu)" \
all
	@cd $(TESTSsrcDIR); $(MAKE) $(EXTRAMAKE2) MAKE=$(MAKE) \
"SRCDIR=$(TESTSsrcDIR)" \
"BLDDIR=$(BLDTESTSsrcDIR)" \
"FORTRAN=$(FORTRAN)" \
"FCx=$(FC_mach)" \
"CCx=$(CC_mach_gnu)" \
"SHARED=$(SHARED_mach)" \
"FOPTIONS=$(FOPTIONS_mach)" \
"FOPTIONSld=$(FOPTIONSld_mach)" \
"COPTIONS=$(COPTIONS_mach_gnu)" \
"COPTIONSld=$(COPTIONSld_mach_gnu)" \
"SYSLIBS=$(SYSLIBSexe_mach_gnu)" \
"SHAREDEXT=$(SHAREDEXT_mach)" \
all

#------------------------------------------------------------------------------
# Show settings.
#------------------------------------------------------------------------------

show: show.$(OS).$(ENV)

show.sunos.bsd: show.supported
show.sunos.bsd5: show.supported
show.sunos.sysV: show.supported
show.sunos.gnu: show.supported
show.sunos.gnu5: show.supported
show.solaris.bsd: show.supported
show.solaris.bsd5: show.supported
show.solaris.sparc: show.supported
show.solaris.sparc64: show.supported
show.solaris.sysV: show.supported
show.solaris.gnu: show.supported
show.solaris.gnu64: show.supported
show.solaris.gnu64i: show.supported
show.solaris.gnu5: show.supported
show.solaris.gnu5_64: show.supported
show.solaris.gnu-64: show.supported
show.ultrix.risc: show.supported
show.ultrix.gnu: show.supported
show.mach.next: show.supported
show.mach.macosx: show.supported
show.mach.gnu: show.supported
show.hpux.std: show.supported
show.hpux.opt: show.supported
show.hpux.posix: show.supported
show.hpux.gnu: show.supported
show.aix.ibm: show.supported
show.aix.gnu: show.supported
show.osf.dec: show.supported
show.osf.gnu: show.supported
show.osf.dec64: show.supported
show.osf.gnu64: show.supported
show.irix34.sgi: show.supported
show.irix34.gnu: show.supported
show.irix5.sgi: show.supported
show.irix5.gnu: show.supported
show.irix6.sgin32: show.supported
show.irix6.sgi64: show.supported
show.irix6.gnu: show.supported
show.linux.gnu: show.supported
show.linux.gnu32: show.supported
show.linux.gnu64: show.supported
show.linux.intel: show.supported
show.breebsd.gnu: show.supported
show.cygwin.gnu: show.supported
show.mingw.gnu: show.supported
show.freebsd.gnu: show.supported
show.posix.vax: show.supported
show.posix.alphaD: show.supported
show.posix.alphaG: show.supported
show.posix.alphaI: show.supported
show.macosx.i386: show.supported
show.macosx.x86_64: show.supported
show.macosx.arm: show.supported
show.macosx.arm64: show.supported
show.macosx.arm32: show.supported

show.supported:
	@echo SHARED is $(SUPPORTED.$(SHARED_$(OS)))
	@echo CURSES is $(SUPPORTED.$(CURSES_$(OS)_$(ENV)))
	@echo FOPTIONS=$(FOPTIONS_$(OS))
	@echo FOPTIONSld=$(FOPTIONSld_$(OS))
	@echo SHAREDEXT=$(SHAREDEXT_$(OS))
	@echo LDOPTIONSlibcdf=$(LDOPTIONS_$(OS)_$(ENV))
	@echo RANLIB=$(RANLIB_$(OS))
	@echo FCx=$(FC_$(OS))
	@echo CCx=$(CC_$(OS)_$(ENV))
	@echo PIC=$(PIC_$(OS)_$(ENV))
	@echo COPTIONS=$(COPTIONS_$(OS)_$(ENV))
	@echo COPTIONSld=$(COPTIONSld_$(OS)_$(ENV))
	@echo CURSESLIB=$(CURSESLIB_$(OS)_$(ENV))
	@echo SYSLIBSexe=$(SYSLIBSexe_$(OS)_$(ENV))
	@echo SYSLIBSshr=$(SYSLIBSshr_$(OS)_$(ENV))

show.notsupported:
	@echo Sorry, \`make show\' is not available on this machine.

#------------------------------------------------------------------------------
# Warning messages.
#------------------------------------------------------------------------------

note1.1st:
	@cat $(SRCDIR)/Note.1st

note1.noCC:
	@cat $(SRCDIR)/Note.noCC

note1.solaris:
	@cat $(SRCDIR)/Note.solaris

note1.intel:
	@cat $(SRCDIR)/Note.intel

note1.macx.no:
	@cat $(SRCDIR)/Note.MacX

note1.macx.yes:
	@$(NOOP)

note1.macx.i386:
	@echo 
	@echo Xcode version: $(XCODEVERSION) no longer supports i386 build...
	@echo
