# ********************************************************************** # # 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. # # ********************************************************************** # # Select an installation base directory. The directory will be created # if it does not exist. # prefix ?= /opt/Ice-$(VERSION) # # The "root directory" for runpath embedded in executables. Can be set # to change the runpath added to Ice executables. The default is # platform dependent (Linux only, on OS X the embedded runpath is always # based on @loader_path). # #embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR) # # Define embedded_runpath as no if you don't want any RPATH added to # the executables (Linux only, on OS X we always add a runpath). # embedded_runpath ?= yes # # Define OPTIMIZE as yes if you want to build with optimization. # Otherwise the Ice extension is built with debug information. # #OPTIMIZE = yes # # Define LP64 as yes if you want to build in 64 bit mode on a platform # that supports both 32 and 64 bit. # #LP64 := yes # # The values below can be overridden by defining them as environment # variables. # # # If multiple versions of Python are installed and you want a specific # version used for building the Ice extension, then set PYTHON to # the specific to the location of the python interpreter. # PYTHON ?= python PYTHON_VERSION ?= python$(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_version())") PYTHON_BASE_VERSION ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_version())") PYTHON_INCLUDE_DIR ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_python_inc())") PYTHON_LIB_DIR ?= $(shell $(PYTHON) -c "import sys; import distutils.sysconfig as ds; sys.stdout.write(ds.get_config_var('LIBPL'))") PYTHON_LIB_SUFFIX ?= $(shell $(PYTHON) -c "import sys; sys.stdout.write(sys.__dict__['abiflags'] if 'abiflags' in sys.__dict__ else '')") PYTHON_LIB_NAME ?= $(PYTHON_VERSION)$(PYTHON_LIB_SUFFIX) PYTHON_FLAGS ?= -I$(PYTHON_INCLUDE_DIR) PYTHON_LIBS ?= -L$(PYTHON_LIB_DIR) -l$(PYTHON_LIB_NAME) # # The build architectures for gcc based builds. The format of these # build flags are OS dependent. For example, under OS X to build # binaries which support both i386 and x86_64 you would use "-arch # i386 -arch x86_64". The default is OS version dependent. Be aware # that this value may conflict with the setting of LP64 above. # #CXXARCHFLAGS = -arch i386 -arch x86_64 # ---------------------------------------------------------------------- # Don't change anything below this line! # ---------------------------------------------------------------------- # # Common definitions # ice_language = python ice_require_cpp = yes ifeq ($(shell test -f $(top_srcdir)/config/Make.common.rules && echo 0),0) include $(top_srcdir)/config/Make.common.rules else include $(top_srcdir)/../config/Make.common.rules endif install_bindir = $(prefix)/$(binsubdir) # # Platform specific definitions # ifeq ($(shell test -f $(top_srcdir)/config/Make.rules.$(UNAME) && echo 0),0) include $(top_srcdir)/config/Make.rules.$(UNAME) else include $(top_srcdir)/../cpp/config/Make.rules.$(UNAME) endif libdir = $(top_srcdir)/python ifndef usr_dir_install install_pythondir = $(prefix)/python install_libdir = $(prefix)/python else # # The install_dir script says where python wants site-packages installed. # install_pythondir = $(shell $(PYTHON) $(top_srcdir)/config/install_dir) install_libdir = $(install_pythondir) endif ifeq ($(UNAME),SunOS) ifeq ($(LP64),yes) libdir = $(top_srcdir)/python$(lp64suffix) install_libdir = $(prefix)/python$(lp64suffix) endif endif ifdef ice_src_dist ICE_LIB_DIR = -L$(ice_cpp_dir)/$(libsubdir) ICE_FLAGS = -I$(ice_cpp_dir)/include else ICE_LIB_DIR = -L$(ice_dir)/$(libsubdir) ICE_FLAGS = -I$(ice_dir)/include endif ICE_LIBS = $(ICE_LIB_DIR) -lIceSSL -lIce -lSlice -lIceUtil CPPFLAGS = ICECPPFLAGS = -I$(slicedir) SLICE2PYFLAGS = $(ICECPPFLAGS) LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) ifdef ice_src_dist SLICE2PY = $(PYTHON) $(top_srcdir)/config/s2py.py SLICEPARSERLIB = $(ice_cpp_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION)) ifeq ($(wildcard $(SLICEPARSERLIB)),) SLICEPARSERLIB = $(ice_cpp_dir)/$(lib64subdir)/$(call mklibfilename,Slice,$(VERSION)) endif else ifeq ($(UNAME),Darwin) SLICE2PY = /usr/local/bin/slice2py else SLICE2PY = $(shell $(PYTHON) -c "import os, sys, slice2py; sys.stdout.write(os.path.normpath(os.path.join(slice2py.__file__, '..', '..', '..', '..', 'bin', 'slice2py')))") endif SLICEPARSERLIB = endif # # A Python extension library cannot have a "lib" prefix, so Python-specific # functions are defined that strip "lib" from the regular library name. # mkpylibfilename = $(subst dy,dylib,$(subst lib,,$(call mklibfilename,$(1),$(2)))) mkpysoname = $(subst dy,dylib,$(subst lib,,$(call mksoname,$(1),$(2)))) mkpylibname = $(subst dy,dylib,$(subst lib,,$(call mklibname,$(1)))) EVERYTHING = all depend clean install .SUFFIXES: .SUFFIXES: .cpp .o .py all:: $(SRCS) %_ice.py: $(slicedir)/%.ice rm -f $(*F).py $(SLICE2PY) $(SLICE2PYFLAGS) $< @mkdir -p .depend @$(SLICE2PY) $(SLICE2PYFLAGS) $< > .depend/$(*F).ice.d .cpp.o: $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< @mkdir -p .depend @$(CXX) -DMAKEDEPEND -MM $(CPPFLAGS) $< > .depend/$(*F).d clean:: -rm -f $(TARGETS) -rm -f core *.o *.pyc *.bak -rm -rf __pycache__ -rm -rf .depend all:: $(SRCS) $(TARGETS) include $(wildcard .depend/*.d) install::