-
Notifications
You must be signed in to change notification settings - Fork 593
/
Make.rules
164 lines (140 loc) · 6.1 KB
/
Make.rules
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# 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 apply to gcc builds on Linux
#
new_dtags ?= no
#
# Define OPTIMIZE as no if you want to build with debug information and
# without optimizations. Otherwise Ice is build with optimizations and
# without debug information.
#
OPTIMIZE ?= yes
#
# 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 ?= $(default-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)
nodejs := $(shell command -v node 2> /dev/null)
#
# Languages, platforms and configurations to build
#
supported-languages ?= $(strip cpp java python ruby php \
$(if $(filter %/node,$(nodejs)),js) \
$(if $(filter %/dotnet,$(dotnet)),csharp) \
$(if $(filter Darwin,$(os)),swift))
supported-configs ?= shared
default-configs ?= $(firstword $(supported-configs))
version = 3.8a0
mmversion = 3.8
soversion = 38a0
#
# 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),$(if $(filter AIX,$(os)),/opt/freeware)),cpp))
else ifneq ($(filter compilers,$(ICE_BIN_DIST)),)
ice_compilers_dir = $(or $(ICE_HOME),$(if $(filter Darwin,$(os)),/usr/local/opt/ice),$(system-install-dir))
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 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_includedir),$(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)))