Make.rules
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# 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