-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
153 lines (140 loc) · 4.48 KB
/
Makefile
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
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice Touch is licensed to you under the terms described
# in the ICE_LICENSE file included in this distribution.
#
# **********************************************************************
top_srcdir = .
#
# Figure out the platforms to build, if empty we'll build all the platforms.
#
PLATFORMS := $(strip $(foreach f,IPHONE IPHONE_SIMULATOR OSX,$(if $(findstring yes,$(COMPILE_FOR_$f)),$f)))
include $(top_srcdir)/config/Make.rules
ifeq ($(USE_BIN_DIST),yes)
SUBDIRS = test
else
SUBDIRS = src test
endif
INSTALL_SUBDIRS =
install::
@for subdir in $(INSTALL_SUBDIRS); \
do \
if test ! -d $$subdir ; \
then \
echo "Creating $$subdir..." ; \
mkdir -p $$subdir ; \
chmod a+rx $$subdir ; \
fi ; \
done
ifeq ($(create_runpath_symlink),yes)
@if test -h $(embedded_runpath_prefix) ; \
then \
if `\rm -f $(embedded_runpath_prefix) 2>/dev/null`; \
then echo "Removed symbolic link $(embedded_runpath_prefix)"; fi \
fi
@if ! test -d $(embedded_runpath_prefix) ; \
then \
if `ln -s $(prefix) $(embedded_runpath_prefix) 2>/dev/null`; \
then echo "Created symbolic link $(embedded_runpath_prefix) --> $(prefix)"; fi \
fi
endif
ifneq ($(USE_BIN_DIST),yes)
install all:: sdks
endif
sdks:
if [ ! -d lib ] || [ ! -d lib/IceTouch ]; \
then \
$(call mkdir,lib) ; \
$(call mkdir,lib/IceTouch) ; \
for sdk in lib/IceTouch/Cpp lib/IceTouch/ObjC; \
do \
$(call mkdir,$$sdk) ;\
$(call mkdir,$$sdk/bin) ;\
$(call mkdir,$$sdk/slice) ;\
for platform in macosx iphoneos iphonesimulator ; \
do \
platform_sdk=$$sdk/$$platform.sdk ;\
$(call mkdir,$$platform_sdk) ;\
$(call mkdir,$$platform_sdk/usr) ;\
$(call mkdir,$$platform_sdk/usr/local) ;\
$(call mkdir,$$platform_sdk/usr/local/include) ;\
$(call mkdir,$$platform_sdk/usr/local/include/IceUtil) ;\
$(call mkdir,$$platform_sdk/usr/local/include/Ice) ;\
$(call mkdir,$$platform_sdk/usr/local/include/IceSSL) ;\
$(call mkdir,$$platform_sdk/usr/local/include/Glacier2) ;\
$(call mkdir,$$platform_sdk/usr/local/include/IceGrid) ;\
$(call mkdir,$$platform_sdk/usr/local/include/IceStorm) ;\
$(call mkdir,$$platform_sdk/usr/local/lib) ;\
$(INSTALL_DATA) $(top_srcdir)/config/$$platform-SDKSettings.plist $$platform_sdk/SDKSettings.plist ;\
chmod a+r $$platform_sdk/SDKSettings.plist ;\
done ;\
for subdir in $(ice_dir)/slice/* ; \
do \
echo "Copying $$subdir to $$sdk/slice..." ; \
cp -fpr $$subdir $$sdk/slice ; \
done ;\
done; \
else \
touch lib/IceTouch; \
fi
ifeq ($(PLATFORMS),)
clean::
rm -rf lib
endif
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
do \
for platform in $(if $(PLATFORMS),$(PLATFORMS),OSX IPHONE IPHONE_SIMULATOR); \
do \
echo "making COMPILE_FOR_$$platform=yes $@ in $$subdir"; \
( cd $$subdir && $(MAKE) -f Makefile $@ COMPILE_FOR_$$platform=yes ) || exit 1; \
done; \
done
tests:
for platform in $(if $(PLATFORMS),$(PLATFORMS),OSX IPHONE IPHONE_SIMULATOR); \
do \
echo "making COMPILE_FOR_$$platform=yes"; \
( cd test && $(MAKE) -f Makefile COMPILE_FOR_$$platform=yes ) || exit 1; \
done; \
ifeq ($(COMPILE_FOR_OSX),yes)
test::
@python $(top_srcdir)/allTests.py
endif
install::
@if test ! -d $(prefix) ; \
then \
echo "Creating $(prefix)..." ; \
$(call mkdir,$(prefix)) ; \
fi
@if test ! -f $(prefix)/ICE_LICENSE ; \
then \
$(call installdata,$(top_srcdir)/ICE_LICENSE,$(prefix)) ; \
fi
@if test ! -f $(prefix)/ICE_LICENSE ; \
then \
$(call installdata,$(ice_dir)/ICE_LICENSE,$(prefix)) ; \
fi
@if test ! -f $(prefix)/LICENSE ; \
then \
$(call installdata,$(ice_dir)/LICENSE,$(prefix)) ; \
fi
@if test ! -d $(prefix)/lib ; \
then \
$(call mkdir,$(prefix)/lib); \
fi
@if test ! -d $(prefix)/lib/IceTouch ; \
then \
$(call mkdir,$(prefix)/lib/IceTouch); \
fi
if [ -d $(prefix)/lib/IceTouch/Cpp ]; \
then \
rm -rf $(prefix)/lib/IceTouch/Cpp; \
fi
cp -fpr $(top_srcdir)/lib/IceTouch/Cpp $(prefix)/lib/IceTouch/Cpp
if [ -d $(prefix)/lib/IceTouch/ObjC ]; \
then \
rm -rf $(prefix)/lib/IceTouch/ObjC; \
fi
cp -fpr $(top_srcdir)/lib/IceTouch/ObjC $(prefix)/lib/IceTouch/ObjC