# # Copyright (c) ZeroC, Inc. All rights reserved. # # # 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. # # If not set, a runpath relative to the path of the executable is # embedded (using @loader_path on macOS and $ORIGIN on Linux). # #embedded_runpath_prefix ?= /opt/Ice-$(mmversion) # # Define embedded_runpath as no if you don't want any runpath added to # the executables. If not set, defaults to to "yes" # embedded_runpath ?= yes # # Define new_dtags as yes if you want the linker to enable the new style # dtags, this will cause the linker to add a runpath entry instead of # a rpath entry. This only aplly to gcc builds on Linux # new_dtags ?= no # # Define OPTIMIZE as no if you want to build with debug iformation and # without optimizations. Otherwise Ice is build with optimizations and # without debug information. # OPTIMIZE ?= yes # # Default Mutex protocol: one of PrioNone or PrioInherit. # #DEFAULT_MUTEX_PROTOCOL ?= PrioNone # # Define PLATFORMS to the list of platforms to build. This defaults # to the first supported platform for this system. # # Run `make print V=supported-platforms' to see the list of supported # platforms on this system. # PLATFORMS ?= $(firstword $(supported-platforms)) # # Configurations to build. This defaults to the first supported # configuration. # # Run `make print V=supported-configs` to see the list of supported # configurations. # CONFIGS ?= $(firstword $(supported-configs)) # # List of binary distributions to build against. Defaults to undefined, # i.e. build all source distributions. This is useful for building # a language mapping or tests against a binary distribution. # #ICE_BIN_DIST ?= # # Third-party libraries (Ice for C++) # # If a third-party library is not installed in a standard location # where the compiler can find it, set the corresponding variable # below to the installation directory of the library. # #MCPP_HOME ?= /opt/mcpp #ICONV_HOME ?= /opt/iconv #EXPAT_HOME ?= /opt/expat #BZ2_HOME ?= /opt/bz2 #LMDB_HOME ?= /opt/lmdb # ---------------------------------------------------------------------- # Don't change anything below this line! # ---------------------------------------------------------------------- os ?= $(shell uname) include $(top_srcdir)/config/Make.rules.$(os) include $(top_srcdir)/config/Make.project.rules include $(top_srcdir)/config/Make.tests.rules dotnet := $(shell command -v dotnet 2> /dev/null) # # Languages, platforms and configurations to build # supported-languages ?= cpp $(if $(filter %/dotnet,$(dotnet)),csharp) java java-compat python js ruby php $(if $(filter Darwin,$(os)),objective-c) supported-configs ?= shared version = 3.7b1 mmversion = 3.7 soversion = 37b1 # # The compatversion is the lowest patch release with the same API. # For example, if 3.7.2 introduces no new API compared to 3.7.1, we # would set version to 3.7.2 and compatversion to 3.7.1. # Used for macOS libraries. # compatversion = $(version) ifneq ($(filter all cpp obj%c,$(ICE_BIN_DIST)),) # NOTE: on macOS, if ICE_HOME isn't set we build against /usr/local/opt/ice because the # XCode SDK is not accessible through /usr/local $(eval $(call create-project-dependencies,ice,$(or $(ICE_HOME),$(if $(filter Darwin,$(os)),/usr/local/opt/ice)),cpp)) endif ifeq ($(filter all cpp,$(ICE_BIN_DIST)),) ice_cpp_cppflags = -I$(top_srcdir)/cpp/include -I$(top_srcdir)/cpp/include/generated else ice_cpp_cppflags = $(if $(ice_includedir),-I$(ice_includedir) $(if $(ice_src_dist),-I$(ice_includedir)/generated)) endif ifeq ($(filter all obj%c,$(ICE_BIN_DIST)),) ice_objc_cppflags = -I$(top_srcdir)/objective-c/include -I$(top_srcdir)/objective-c/include/generated else ice_objc_cppflags = $(if $(ice_includedir),-I$(ice_includedir) $(if $(ice_src_dist),-I$(ice_includedir)/generated)) endif ifeq ($(filter all cpp,$(ICE_BIN_DIST)),) bindir = $(call mappingdir,$(or $1,$(currentdir)),bin) else bindir = $(ice_bindir) endif # Use the bin distribution if ICE_BIN_DIST=all or if ICE_BIN_DIST=cpp and processing a file from the cpp directory. use-bin-dist = $(or $(filter all,$(ICE_BIN_DIST)),\ $(and $(filter cpp,$(ICE_BIN_DIST)),$(filter %/cpp/,$(call mappingdir,$(or $1,$(currentdir)))))) bindir = $(if $(use-bin-dist),$(ice_bindir),$(call mappingdir,$(or $1,$(currentdir)),bin)) libdir = $(if $(use-bin-dist),$(ice_libdir),$(call mappingdir,$(or $1,$(currentdir)),lib)) includedir = $(if $(use-bin-dist),$(ice_slicedir),$(call mappingdir,$(or $1,$(currentdir)),include)) slicedir = $(if $(use-bin-dist),$(ice_slicedir),$(top_srcdir)/slice) sdkdir = $(if $(use-bin-dist),$(ice_home)/sdk,$(top_srcdir)/sdk) srcdir = $(call mappingdir,$(or $1,$(currentdir)),src) usr_dir_install := $(or $(filter yes,$(USR_DIR_INSTALL)),$(filter /usr%,$(prefix))) install_bindir ?= $(prefix)/bin install_libdir ?= $(prefix)/lib install_slicedir ?= $(prefix)$(if $(usr_dir_install),/share/ice)/slice install_includedir ?= $(prefix)/include install_docdir ?= $(prefix)$(if $(usr_dir_install),/share/ice) install_mandir ?= $(prefix)$(if $(usr_dir_install),/share)/man install_configdir ?= $(prefix)$(if $(usr_dir_install),/share/ice,/config) install_sdkdir ?= $(prefix)/sdk # # Support for 3rd party libraries # thirdparties := mcpp iconv expat bz2 lmdb mcpp_home := $(MCPP_HOME) iconv_home := $(ICONV_HOME) expat_home := $(EXPAT_HOME) bz2_home := $(BZ2_HOME) lmdb_home := $(LMDB_HOME) $(foreach l,$(thirdparties),$(eval $(call make-lib,$l))) # # When building on Sierra, use clang from the Xcode macOS X SDK instead of relying on the # command line tools. Outdated Security.framework system headers are used otherwise with # the command line compiler (no TLS1.3 enum support). # ifeq ($(os),Darwin) ifneq ($(filter 16.%,$(shell uname -r)),) macosx_cc = xcrun -sdk macosx clang macosx_cxx = xcrun -sdk macosx clang++ macosx_cppflags += -I/usr/local/include macosx_ldflags += -L/usr/local/lib endif endif