###############################################################################
#
#  This software is distributed as is, without any warranty of any kind, either
#  express or implied as further specified in the GNU Public License.
#  This software may be used and distributed according to the terms of the
#  GNU Public License.
#
###############################################################################
#
# ubslib Makefile
#

#
# Revision History:
#
# When       Who   What
# 09/06/00   DNA   First cut
# 10/23/01   RLT   added Solaris
#

ECHO= @
MAKE_ECHO= -s
MAKE=make

# Try to positively identify the OS. Keep the first match.

# See if OSTYPE contains "bsd" (case insensitive)
ifndef THIS_OSTYPE
  ifneq ($(shell echo $(OSTYPE) | grep -i bsd),)
    THIS_OSTYPE= bsd
  endif
endif

# See if OSTYPE contains "linux" (case insensitive)
ifndef THIS_OSTYPE
  ifneq ($(shell uname -a | grep -i linux),)
    THIS_OSTYPE= Linux
  endif
endif

# See if uname contains "SunOS" (case insensitive)
ifndef THIS_OSTYPE
  ifneq ($(shell uname -a | grep -i SunOS),)
    THIS_OSTYPE= solaris
    MAKE=gmake
  endif
  ifneq ($(shell uname -a | grep -i solaris),)
    THIS_OSTYPE= solaris
    MAKE=gmake
  endif
endif

# See if OSTYPE contains "vxworks" (case insensitive)
ifndef THIS_OSTYPE
  ifneq ($(shell echo $(OSTYPE) | grep -i vxworks),)
    THIS_OSTYPE= vxworks
  endif
endif

all clean rebuild install test_all shared:
	$(ECHO) $(MAKE) $(MAKE_ECHO) -f Makefile.$(THIS_OSTYPE) $@














