summaryrefslogtreecommitdiff
path: root/cpp/config/Make.rules
blob: e370286f0d107eba1e37565184b28852593e11fe (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# **********************************************************************
#
# Copyright (c) 2003-2017 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!
# ----------------------------------------------------------------------

#
# Supported configurations
#
supported-configs = shared static cpp11-shared cpp11-static

-include	$(lang_srcdir)/config/Make.rules.$(os)
ifeq ($(os),Darwin)
include		$(lang_srcdir)/config/Make.xcodesdk.rules
endif

#
# Define which projects to build for the different configurations.
#
coreandstub_components	= IceUtil \
			  Ice \
			  IceSSL \
		   	  IceDiscovery \
			  IceLocatorDiscovery \
			  Glacier2 \
			  IceStorm \
			  IceGrid \
			  IceBox \
			  IcePatch2

# Add the Bluetooth transport for Debian/Ubuntu
ifneq ($(filter debian ubuntu,$(linux_id)),)
coreandstub_components	+= IceXML IceBT
endif

#
# Build all the projects with the shared configuration, except IceUtil and Slice
# that are static-only
#
shared_projects		= %
shared_excludes         = IceUtil Slice

#
# Build only few components with the static configuration (core and stubs)
#
static_components       = $(coreandstub_components)
static_projects         = test/%
static_excludes         = test/Ice/library

#
# Components and projects which are built with C++11
#
cpp11_components	= $(coreandstub_components) icebox

cpp11_projects		= test/Common \
			  test/IceUtil/% \
			  test/Slice/% \
			  test/Ice/% \
			  test/IceSSL/% \
			  test/IceDiscovery/% \
			  test/IceBox/%

cpp11_excludes  	= IcePatch2 \
			  test/Ice/gc

#
# If building on a Linux multilib platform, we restrict what we build for
# the 32-bits architecture. We basically, build the same set of components
# as C++11 (libraries and icebox executable).
#
ifeq ($(multilib-platform),yes)
x86_components 		= $(coreandstub_components) IceDB IceStormService icebox
x86_projects		= test/%
endif

#
# C++11 configuration to build the C++11 mapping.
#
# Appends cpp11 to the configuration directory name. If we are building the
# target outside the component build directory, we also append the ++11
# suffix to the targetname. This is for example how icebox is compiled as
# icebox++11 when compiled with the C++11 configuration. We also don't add
# the cpp11 name to the target directory if building outside the build
# directory.
#
cpp11_cppflags		= -DICE_CPP11_MAPPING -std=c++11
cpp11_targetname 	= $(if $(or $(filter-out $($1_target),program),$(filter $(bindir)%,$($4_targetdir))),++11)
cpp11_targetdir		= $(if $(filter %/build,$5),cpp11)

#
# $(call make-cpp-src-project,$1=project)
#
define make-cpp-src-project
ifeq ($(filter all cpp,$(ICE_BIN_DIST)),)
$1_slicecompiler 	:= slice2cpp
$1_sliceflags		+= -I$(slicedir)
$1_cppflags 		+= -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC
$(make-project)
srcs:: $1
endif
endef

#
# $(call make-cpp-test-project,$1=project)
#
define make-cpp-test-project
$1_slicecompiler 	:= slice2cpp
$1_sliceflags		+= -I$(slicedir)
$1_cppflags		+= -I$1/generated -I$1 -Itest/include -I$(includedir)
ifeq ($(filter all cpp,$(ICE_BIN_DIST)),)
$1_cppflags		+= -I$(includedir)/generated
endif
$(make-project)
tests:: $1
endef

#
# $(create-cpp-test-project $1=test)
#
define create-cpp-test-project
$1_srcext		:= cpp
$1_dependencies 	:= $$(or $$($1_dependencies),TestCommon Ice)

# Also link with IceSSL and IceBT (Debian/Ubuntu) when compiling the project with the static configuration
$1[static]_dependencies	:= IceSSL $(if $(filter debian ubuntu,$(linux_id)),IceBT)

# Dependencies and target dirs for Xcode SDK test projects
$1[xcodesdk]_dependencies 			:= IceSSL
$1[iphoneos-xcodesdk]_targetdir			:= test/ios/bundles/Bundles-iphoneos/$(subst /,_,$1)
$1[iphonesimulator-xcodesdk]_targetdir		:= test/ios/bundles/Bundles-iphonesimulator/$(subst /,_,$1)
$1[iphoneos-cpp11-xcodesdk]_targetdir		:= test/ios/bundles/Bundles++11-iphoneos/$(subst /,_,$1)
$1[iphonesimulator-cpp11-xcodesdk]_targetdir	:= test/ios/bundles/Bundles++11-iphonesimulator/$(subst /,_,$1)

$(create-test-project)
endef

#
# Create top-level include/config dir
#
$(DESTDIR)$(install_includedir) $(DESTDIR)$(install_configdir):
	$(Q)$(MKDIR) $@