# ********************************************************************** # # Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** # ---------------------------------------------------------------------- # Don't change anything below this line! # ---------------------------------------------------------------------- SHELL = /bin/sh VERSION_MAJOR = 3 VERSION_MINOR = 6 VERSION_PATCH = 2 VERSION = 3.6.2 SHORT_VERSION = 3.6 SOVERSION = 36 INSTALL = cp -fp INSTALL_PROGRAM = ${INSTALL} INSTALL_LIBRARY = ${INSTALL} INSTALL_DATA = ${INSTALL} OBJEXT = .o UNAME := $(shell uname) MACHINE_TYPE := $(shell uname -m) # # Ensure ice_language has been set by the file that includes this one. # ifndef ice_language $(error ice_language must be defined) endif ifeq ($(USE_BIN_DIST),yes) ice_bin_dist = 1 endif ifeq ($(UNAME),Darwin) usr_dir = /usr/local else usr_dir = /usr endif # # usr_dir_install means we want to install with a /usr style layout. # ifeq ($(prefix), /usr) usr_dir_install = 1 endif ifeq ($(prefix), /usr/local) usr_dir_install = 1 endif # # A /usr style layout can be forced by setting USR_DIR_INSTALL=yes. # ifeq ($(USR_DIR_INSTALL),yes) usr_dir_install = 1 endif ifeq ($(UNAME),SunOS) ifeq ($(MACHINE_TYPE),sun4u) lp64suffix = /64 lp64binsuffix = /sparcv9 endif ifeq ($(MACHINE_TYPE),sun4v) lp64suffix = /64 lp64binsuffix = /sparcv9 endif ifeq ($(MACHINE_TYPE),i86pc) lp64suffix = /amd64 lp64binsuffix = /amd64 endif endif ifeq ($(UNAME),HP-UX) lp64suffix = /pa20_64 lp64binsuffix = /pa20_64 endif ifeq ($(UNAME),Linux) ifeq ($(MACHINE_TYPE),x86_64) # # Ubuntu. # ifeq ($(shell test -d $(usr_dir)/lib/x86_64-linux-gnu && echo 0),0) lp64suffix = /x86_64-linux-gnu endif # # Rhel/SLES # ifeq ($(shell test -d $(usr_dir)/lib64 && echo 0),0) lp64suffix = 64 endif ifeq ($(LP64),) LP64 = yes endif endif ifneq ($(STATICLIBS),yes) ifneq ($(LP64),yes) binsuffix = 32 endif endif endif ifeq ($(shell test -d $(usr_dir)/lib/i386-linux-gnu && echo 0),0) lp32suffix = /i386-linux-gnu endif ifeq ($(CPP11),yes) ifneq ($(UNAME),Darwin) cpp11libdirsuffix = /c++11 cpp11libsuffix = ++11 cpp11sonamedir = ../ binsuffix := $(binsuffix)$(cpp11libsuffix) endif endif ifneq ($(findstring MINGW,$(UNAME)),) UNAME := MINGW lp64suffix := /x64 COMPILER_MACHINE := $(shell $(CXX) -dumpmachine) ifeq ($(COMPILER_MACHINE),x86_64-w64-mingw32) LP64 := yes endif endif ifeq ($(LP64),yes) libsubdir := lib$(lp64suffix) binsubdir := bin$(lp64binsuffix) else libsubdir := lib$(lp32suffix) binsubdir := bin # # For x86 builds in x86_64 machines lib64subdir points to the x86_64 lib # directory and libsubdir to the x86 lib directory. # ifeq ($(MACHINE_TYPE),x86_64) lib64subdir = lib$(lp64suffix) endif endif # # The following variables might also be defined: # # - slice_translator: the name of the slice translator required for the build. # Setting this variable is required when building source trees other than the # the source distribution (e.g.: the demo sources). # # - ice_require_cpp: define this variable to check for the presence of the C++ # dev kit and check for the existence of the include/Ice/Config.h header. # # # First, check if we're building a source distribution. # # If building from a source distribution, ice_dir is defined to the # top-level directory of the source distribution and ice_cpp_dir is # defined to the directory containing the C++ binaries and headers to # use to build the sources. # ifndef ice_bin_dist ifeq ($(shell test -d $(top_srcdir)/../$(ice_language) && echo 0),0) ice_dir = $(top_srcdir)/.. ice_src_dist = 1 # # When building a source distribution, if ICE_HOME is specified, it takes precedence over # the source tree for building the language mappings. For example, this can be used to # build the Python language mapping using the translators from the distribution specified # by ICE_HOME. # ifneq ($(ICE_HOME),) ifeq ($(shell test -d $(ICE_HOME)/cpp/bin && echo 0), 0) # # ICE_HOME is pointing at the source distribution, so we just ignore it. # ice_cpp_dir = $(ice_dir)/cpp else ifdef slice_translator ifneq ($(shell test -f $(ICE_HOME)/$(binsubdir)/$(slice_translator) && echo 0), 0) $(error Unable to find $(slice_translator) in $(ICE_HOME)/$(binsubdir), please verify ICE_HOME is properly configured and Ice is correctly installed.) endif ifeq ($(shell test -f $(ice_dir)/cpp/bin/$(slice_translator) && echo 0), 0) $(warning Found $(slice_translator) in both ICE_HOME/bin and $(ice_dir)/cpp/bin, ICE_HOME/bin/$(slice_translator) will be used!) endif ice_cpp_dir = $(ICE_HOME) else $(warning Ignoring ICE_HOME environment variable to build current source tree.) ice_cpp_dir = $(ice_dir)/cpp endif endif else ice_cpp_dir = $(ice_dir)/cpp endif endif ifeq ($(shell test -d $(top_srcdir)/ice/$(ice_language) && echo 0),0) ice_dir = $(top_srcdir)/ice ice_src_dist = 1 # # When building a source distribution, if ICE_HOME is specified, it takes precedence over # the source tree for building the language mappings. For example, this can be used to # build the Python language mapping using the translators from the distribution specified # by ICE_HOME. # ifneq ($(ICE_HOME),) ifdef slice_translator ifneq ($(shell test -f $(ICE_HOME)/$(binsubdir)/$(slice_translator) && echo 0), 0) $(error Unable to find $(slice_translator) in $(ICE_HOME)/$(binsubdir), please verify ICE_HOME is properly configured and Ice is correctly installed.) endif ifeq ($(shell test -f $(ice_dir)/cpp/bin/$(slice_translator) && echo 0), 0) $(warning Found $(slice_translator) in both ICE_HOME/bin and $(ice_dir)/cpp/bin, ICE_HOME/bin/$(slice_translator) will be used!) endif ice_cpp_dir = $(ICE_HOME) else $(warning Ignoring ICE_HOME environment variable to build current source tree.) ice_cpp_dir = $(ice_dir)/cpp endif else ice_cpp_dir = $(ice_dir)/cpp endif endif endif # # Then, check if we're building against a binary distribution. # ifndef ice_src_dist ifndef slice_translator slice_translator = slice2cpp endif ifneq ($(ICE_HOME),) ifneq ("$(ice_language)", "python") ifneq ($(shell test -f $(ICE_HOME)/$(binsubdir)/$(slice_translator) && echo 0), 0) $(error Unable to find $(slice_translator) in $(ICE_HOME)/$(binsubdir), please verify ICE_HOME is properly configured and Ice is correctly installed.) endif endif ice_dir = $(ICE_HOME) else ifeq ($(shell test -f $(top_srcdir)/bin/$(slice_translator) && echo 0), 0) ice_dir = $(top_srcdir) else ifeq ($(shell test -f $(usr_dir)/bin/$(slice_translator) && echo 0), 0) ice_dir = $(usr_dir) ifeq ($(shell test -f /opt/Ice-$(VERSION)/bin/$(slice_translator) && echo 0), 0) $(warning Found $(slice_translator) in both $(usr_dir)/bin and /opt/Ice-$(VERSION)/bin, $(usr_dir)/bin/$(slice_translator) will be used!) endif else ifeq ($(shell test -f /opt/Ice-$(VERSION)/$(binsubdir)/$(slice_translator) && echo 0), 0) ice_dir = /opt/Ice-$(VERSION) endif endif endif endif ifndef ice_dir $(error Unable to find a valid Ice distribution, please verify ICE_HOME is properly configured and Ice is correctly installed.) endif ice_bin_dist = 1 ice_cpp_dir = $(ice_dir) endif # # If ice_require_cpp is defined, ensure the C++ headers exist # ifeq ("$(ice_language)", "python") ifdef ice_bin_dist skip_cpp_check = 1 endif endif ifndef skip_cpp_check ifeq ("$(ice_require_cpp)", "yes") ifdef ice_src_dist ice_cpp_header = $(ice_cpp_dir)/include/Ice/Ice.h else ice_cpp_header = $(ice_dir)/include/Ice/Ice.h endif ifneq ($(shell test -f $(ice_cpp_header) && echo 0),0) $(error Unable to find the C++ header file $(ice_cpp_header), please verify ICE_HOME is properly configured and Ice is correctly installed.) endif endif endif # # Clear the embedded runpath prefix if building against RPM distribution. # ifeq ($(ice_dir), $(usr_dir)) embedded_runpath_prefix = endif # # Set slicedir to the path of the directory containing the Slice files. # ifeq ($(ice_dir), $(usr_dir)) slicedir = $(usr_dir)/share/slice else slicedir = $(ice_dir)/slice endif # # Installation location for slice and doc files. # ifdef usr_dir_install install_slicedir = $(prefix)/share/Ice-$(VERSION)/slice install_docdir = $(prefix)/share/Ice-$(VERSION) else install_slicedir = $(prefix)/slice install_docdir = $(prefix) endif # # Set environment variables for the Slice translator. # ifneq ($(ice_dir), $(usr_dir)) ifdef ice_src_dist ice_lib_dir = $(ice_cpp_dir)/$(libsubdir) else ifndef lib64subdir ice_lib_dir = $(ice_dir)/$(libsubdir) else ice_lib_dir = $(ice_dir)/$(lib64subdir) endif endif # # We always set library path because the build needs to work # whe slice compiler was built without RPATH # ifeq ($(UNAME),Linux) export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH) endif ifeq ($(UNAME),SunOS) ifeq ($(LP64),yes) export LD_LIBRARY_PATH_64 := $(ice_lib_dir):$(LD_LIBRARY_PATH_64) else export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH) endif endif ifeq ($(UNAME),AIX) export LIBPATH := $(ice_lib_dir):$(LIBPATH) endif ifeq ($(UNAME),HP-UX) ifeq ($(LP64),yes) export LD_LIBRARY_PATH := $(ice_lib_dir)$(lp64dir):$(SHLIB_PATH) else export SHLIB_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH) endif endif ifeq ($(UNAME),FreeBSD) export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH) endif ifeq ($(UNAME),OSF1) export LD_LIBRARY_PATH := $(ice_lib_dir):$(LD_LIBRARY_PATH) endif ifneq ($(findstring MINGW,$(UNAME)),) set PATH := $(ice_lib_dir);$(PATH) endif endif # # Default functions for shared library names (we have to defined them here # for the SLICE2PARSERLIB dependency) # ifeq ($(mklibfilename),) ifeq ($(UNAME),Darwin) mklibfilename = $(if $(2),lib$(1)$(cpp11libsuffix).$(2).dylib,lib$(1)$(cpp11libsuffix).dylib) else mklibfilename = $(if $(2),lib$(1)$(cpp11libsuffix).so.$(2),lib$(1)$(cpp11libsuffix).so) endif endif ifeq ($(mksoname),) ifeq ($(UNAME),Darwin) mksoname = $(if $(2),lib$(1)$(cpp11libsuffix).$(2).dylib,lib$(1).dylib) else mksoname = $(if $(2),lib$(1)$(cpp11libsuffix).so.$(2),lib$(1).so) endif endif ifeq ($(mklibname),) ifeq ($(STATICLIBS),yes) mklibname = lib$(1)$(cpp11libsuffix).a else ifeq ($(UNAME),Darwin) mklibname = lib$(1).dylib else mklibname = lib$(1).so endif endif endif ifndef mklibtargets ifeq ($(STATICLIBS),yes) mklibtargets = $(3) else mklibtargets = $(1) $(2) $(3) endif endif ifeq ($(installlib),) ifeq ($(STATICLIBS),yes) installlib = $(INSTALL) $(2)/$(5) $(1); \ chmod a+rx $(1)/$(5) else installlib = $(INSTALL) $(2)/$(3) $(1); \ rm -f $(1)/$(4); ln -s $(3) $(1)/$(4); \ rm -f $(1)$(cpp11libdirsuffix)/$(5); ln -s $(cpp11sonamedir)$(4) $(1)$(cpp11libdirsuffix)/$(5); \ chmod a+rx $(1)/$(3) endif endif ifeq ($(installdata),) installdata = $(INSTALL_DATA) $(1) $(2); \ chmod a+r $(2)/$(notdir $(1)) endif ifeq ($(installprogram),) installprogram = $(INSTALL_PROGRAM) $(1) $(2); \ chmod a+rx $(2)/$(notdir $(1)) endif ifeq ($(mkdir),) mkdir = $(if $(2),mkdir $(2) $(1),mkdir $(1)); \ chmod a+rx $(1) endif all:: ifeq ($(wildcard $(top_srcdir)/../ICE_LICENSE.txt),) TEXT_EXTENSION = else TEXT_EXTENSION = .txt endif install-common:: @if test ! -d $(DESTDIR)$(prefix) ; \ then \ echo "Creating $(prefix)..." ; \ $(call mkdir,$(DESTDIR)$(prefix), -p) ; \ fi @if test ! -d $(DESTDIR)$(install_slicedir) ; \ then \ echo "Creating $(DESTDIR)$(install_slicedir)..." ; \ $(call mkdir, $(DESTDIR)$(install_slicedir), -p) ; \ if test ! -z "$(usr_dir_install)" ; \ then \ ln -s Ice-$(VERSION)/slice $(DESTDIR)/$(prefix)/share/slice ; \ fi ; \ cd $(top_srcdir)/../slice ; \ for subdir in * ; \ do \ echo "Copying slice/$$subdir to $(DESTDIR)$(install_slicedir)..." ; \ cp -fpr $$subdir $(DESTDIR)$(install_slicedir) ; \ done ; \ fi @if test ! -f $(DESTDIR)$(install_docdir)/ICE_LICENSE$(TEXT_EXTENSION) ; \ then \ $(call installdata,$(top_srcdir)/../ICE_LICENSE$(TEXT_EXTENSION),$(DESTDIR)$(install_docdir)) ; \ fi @if test ! -f $(DESTDIR)$(install_docdir)/LICENSE$(TEXT_EXTENSION) ; \ then \ $(call installdata,$(top_srcdir)/../LICENSE$(TEXT_EXTENSION),$(DESTDIR)$(install_docdir)) ; \ fi