Make.rules 2.6 KB
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

# ----------------------------------------------------------------------
# Don't change anything below this line!
# ----------------------------------------------------------------------

-include        $(lang_srcdir)/config/Make.rules.$(os)

#
# Supported configurations
#
supported-configs               = shared static

# Validate platforms and configs
$(eval $(call validate-config))

#
# Support for Ice libraries
#
cpp-dependencies                = Ice Glacier2 IceGrid IcePatch2 IceSSL IceDiscovery IceLocatorDiscovery IceStorm IceBox
Ice_libs                        = bz2
Glacier2_dependencies           = Ice
IceGrid_dependencies            = Glacier2 Ice
IcePatch2_dependencies          = Ice
IcePatch2_libs                  = bz2
IceSSL_dependencies             = Ice
IceDiscovery_dependencies       = Ice
IceLocatorDiscovery_dependencies = Ice
IceStorm_dependencies           = Ice
IceBox_dependencies             = Ice

ifneq ($(IceBT_system_libs),)
cpp-dependencies                += IceBT
IceBT_dependencies              := Ice
endif

# Append ++11 suffix to libraries
shared_targetname               = $(if $(filter-out $($1_target),program),++11)
static_targetname               = $(if $(filter-out $($1_target),program),++11)

# Create component dependency variables
$(eval $(call create-project-dependencies,ice,$(ICE_HOME),cpp,cpp,$(cpp-dependencies)))

#
# Don't set platform targetdir/targetname for demos. The executables are always produced
# in the demo directory with the same name regardless of the config/platform.
#
$(foreach v,$(supported-platforms) platform config,$(eval $v_targetdir := ) $(eval $v_targetname := ))

slice2cpp_targetext             = cpp
slice2cpp_path                  = $(or $(ice_bindir[$(build-platform)]),$(ice_bindir))/slice2cpp

ifeq ($(wildcard $(slice2cpp_path)),)
$(error Can't find Ice distribution, please set ICE_HOME to the Ice installation directory)
endif

#
# $(create-cpp-demo-project $1=demo)
#
define create-cpp-demo-project
$1_targetdir            := $1
$1_srcext               := cpp
$1_dependencies         := $$(or $$($1_dependencies),Ice)
$1_slicecompiler        := slice2cpp
$1_sliceflags           := -I$(ice_slicedir) -I$1 $$($1_sliceflags)
$1_cppflags             := -DICE_CPP11_MAPPING -std=c++11 -I$1 -I$1/generated $(ice_cppflags) $$($1_cppflags)
$1_caninstall           := no

# Also link with IceSSL, IceDiscovery and IceLocatorDiscovery when compiling the project with the static configuration
$1[static]_dependencies := $$(or $$($1_dependencies[static]),IceSSL IceDiscovery IceLocatorDiscovery)

$(create-demo-project)
endef