-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
1178 lines (1080 loc) · 50.2 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##
# Wrapper makefile for ICU
# Copyright (C) 2003-2014 Apple Inc. All rights reserved.
#
# See http://www.gnu.org/manual/make/html_chapter/make_toc.html#SEC_Contents
# for documentation on makefiles. Most of this was culled from the ncurses makefile.
#
#################################
# Notes on building for AAS using Windows (7) + Visual Studio (2010) + Cygwin:
#
# Either this should be run indirectly from the VS command prompt via the
# BuildICUForAAS script or project, using the instructions there (which build
# both 32-bit and 64-bit), or it should be run from within Cygwin using the
# following instructions or equivalent (different steps for 32-bit or 64-bit):
#
# 1. From VS command prompt, run vcvarsall.bat to set various environment variables.
# For a 32-bit build:
# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
# For a 64-bit build:
# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
#
# 2. Launch Cygwin, e.g.
# > C:\cygwin\Cygwin.bat
#
# 3. Within cygwin, cd to the top level of the ICU sources directory, e.g.
# $ cd ICU
#
# 4. Adjust the PATH to put the appropriate VC tools directory first:
# For a 32-bit build:
# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/":$PATH
# For a 64-bit build:
# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/":$PATH
#
# 5. Run the ICU makefile
# For a 32-bit build:
# make [install] WINDOWS=YES [ARCH64=NO] [DSTROOT=...]
# For a 64-bit build:
# make [install] WINDOWS=YES ARCH64=YES [DSTROOT=...]
#
#################################
#################################
#################################
# MAKE VARS
#################################
#################################
# ':=' denotes a "simply expanded" variable. It's value is
# set at the time of definition and it never recursively expands
# when used. This is in contrast to using '=' which denotes a
# recursively expanded variable.
# Sane defaults, which are typically overridden on the command line.
WINDOWS=NO
LINUX=NO
ARCH64=NO
# chicken and egg problem: we can't use cygpath until PATH & SHELL are set,
# but we have to convert VS100VCTOOLS_PATH in order to set PATH. So instead we
# convert using subst.
ifeq "$(WINDOWS)" "YES"
ifneq "$(VS100VCTOOLS_PATH)" ""
VS100VCTOOLS_CYGPATH:= /cygdrive/$(subst :/,/,$(subst \,/,$(VS100VCTOOLS_PATH)))
PATH:=$(VS100VCTOOLS_CYGPATH):/usr/local/bin/:/usr/bin/:$(PATH)
endif
endif
$(info # PATH=$(PATH))
# For some reason, cygwin bash (at least when run non-login) needs to use
# bash for pwd, echo etc. (but uname does not work, see below)
ifeq "$(WINDOWS)" "YES"
SHELL := /bin/bash
else
SHELL := /bin/sh
endif
# if building for windows from batch script, convert Win-style paths
# for SRCROOT etc. to cygwin-style paths. Don't define them if not
# already defined.
ifeq "$(WINDOWS)" "YES"
ifneq "$(VS100VCTOOLS_PATH)" ""
ifdef SRCROOT
SRCROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SRCROOT)))
endif
ifdef OBJROOT
OBJROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(OBJROOT)))
endif
ifdef DSTROOT
DSTROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(DSTROOT)))
endif
ifdef SYMROOT
SYMROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SYMROOT)))
endif
endif
endif
ifndef SRCROOT
SRCROOT:=$(shell pwd)
endif
ifndef OBJROOT
OBJROOT:=$(SRCROOT)/build
endif
ifndef DSTROOT
DSTROOT:=$(OBJROOT)
endif
ifndef SYMROOT
SYMROOT:=$(OBJROOT)
endif
ifeq "$(WINDOWS)" "YES"
ifeq "$(ARCH64)" "YES"
OBJROOT_CURRENT=$(OBJROOT)/obj64
SYMROOT_CURRENT=$(SYMROOT)/obj64
else
OBJROOT_CURRENT=$(OBJROOT)/obj32
SYMROOT_CURRENT=$(SYMROOT)/obj32
endif
else ifeq "$(LINUX)" "YES"
ifeq "$(ARCH64)" "YES"
OBJROOT_CURRENT=$(OBJROOT)/obj64
SYMROOT_CURRENT=$(SYMROOT)/obj64
else
OBJROOT_CURRENT=$(OBJROOT)/obj32
SYMROOT_CURRENT=$(SYMROOT)/obj32
endif
else
OBJROOT_CURRENT=$(OBJROOT)
SYMROOT_CURRENT=$(SYMROOT)
endif
CROSSHOST_OBJROOT=$(OBJROOT)/crossbuildhost
APPLE_INTERNAL_DIR=/AppleInternal
RC_ARCHS=
MAC_OS_X_VERSION_MIN_REQUIRED=1070
OSX_HOST_VERSION_MIN_STRING=10.7
IOS_VERSION_TARGET_STRING=7.0
OSX_VERSION_TARGET_STRING=10.9
$(info # SRCROOT=$(SRCROOT))
$(info # DSTROOT=$(DSTROOT))
$(info # OBJROOT=$(OBJROOT))
# For some reason, under cygwin, bash uname is not found, and
# sh uname does not produce a result with -p or -m. So we just
# hardcode here.
ifeq "$(WINDOWS)" "YES"
UNAME_PROCESSOR:=i386
else
UNAME_PROCESSOR:=$(shell uname -p)
endif
ifeq "$(RC_INDIGO)" "YES"
-include $(DEVELOPER_DIR)/AppleInternal/Makefiles/Makefile.indigo
ifndef SDKROOT
SDKROOT=$(INDIGO_PREFIX)
endif
DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
else
DEST_ROOT=$(DSTROOT)/
endif
ifndef SDKROOT
SDKPATH:=/
else ifeq "$(SDKROOT)" ""
SDKPATH:=/
else
SDKPATH:=$(shell xcodebuild -version -sdk $(SDKROOT) Path)
ifeq "$(SDKPATH)" ""
SDKPATH:=/
endif
endif
ifneq "$(RC_ARCHS)" ""
ifneq "$(filter arm armv6 armv7 armv7s arm64,$(RC_ARCHS))" ""
CROSS_BUILD=YES
BUILD_TYPE=DEVICE
else ifeq "$(RC_INDIGO)" "YES"
CROSS_BUILD=YES
BUILD_TYPE=SIMULATOR
else
CROSS_BUILD=NO
BUILD_TYPE=
endif
INSTALLHDRS_ARCH=-arch $(shell echo $(RC_ARCHS) | cut -d' ' -f1)
else
CROSS_BUILD=NO
INSTALLHDRS_ARCH=
BUILD_TYPE=
endif
$(info # RC_ARCHS=$(RC_ARCHS))
$(info # INSTALLHDRS_ARCH=$(INSTALLHDRS_ARCH))
$(info # buildhost=$(UNAME_PROCESSOR))
$(info # SDKROOT=$(SDKROOT))
$(info # SDKPATH=$(SDKPATH))
$(info # RC_INDIGO=$(RC_INDIGO))
$(info # CROSS_BUILD=$(CROSS_BUILD))
$(info # BUILD_TYPE=$(BUILD_TYPE))
$(info # DEST_ROOT=$(DEST_ROOT))
# FORCEENDIAN below is to override silly configure behavior in which if
# __APPLE_CC__ is defined and archs are in { ppc, ppc64, i386, x86_64 }
# then it assumes a universal build (ac_cv_c_bigendian=universal) with
# data file initially built big-endian.
#
ifeq "$(CROSS_BUILD)" "YES"
RC_ARCHS_FIRST=$(shell echo $(RC_ARCHS) | cut -d' ' -f1)
TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin14.0.0
ENV_CONFIGURE_ARCHS=-arch $(RC_ARCHS_FIRST)
ICUPKGTOOLIBS="$(CROSSHOST_OBJROOT)/lib:$(CROSSHOST_OBJROOT)/stubdata"
ICUPKGTOOL=$(CROSSHOST_OBJROOT)/bin/icupkg
ifeq "$(filter-out i386 x86_64,$(RC_ARCHS))" ""
FORCEENDIAN= ac_cv_c_bigendian=no
else
FORCEENDIAN=
endif
else ifeq "$(LINUX)" "YES"
TARGET_SPEC=$(UNAME_PROCESSOR)-unknown-linux-gnu
ENV_CONFIGURE_ARCHS=
ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
FORCEENDIAN=
else
TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin14.0.0
ENV_CONFIGURE_ARCHS=
ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
FORCEENDIAN=
endif
$(info # TARGET_SPEC=$(TARGET_SPEC))
$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
ICU_TARGET_VERSION_FOR_TZ_EXTRA :=
ifeq "$(BUILD_TYPE)" "SIMULATOR"
ICU_TARGET_VERSION_FOR_TZ_EXTRA := -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING)
endif
ifeq "$(BUILD_TYPE)" "DEVICE"
THUMB_FLAG = -mthumb
else
THUMB_FLAG =
endif
# even for a crossbuild host build, we want to use the target's latest tzdata as pointed to by latest_tzdata.tar.gz
export TZDATA:=$(SDKPATH)/usr/local/share/tz/$(shell readlink $(SDKPATH)/usr/local/share/tz/latest_tzdata.tar.gz)
$(info # TZDATA=$(TZDATA))
ifeq "$(WINDOWS)" "YES"
EMBEDDED:=0
else ifeq "$(LINUX)" "YES"
CC := gcc
CXX := g++
EMBEDDED:=0
ISYSROOT =
else
ifeq "$(BUILD_TYPE)" ""
HOSTCC := $(shell xcrun -sdk $(SDKPATH) -find cc)
HOSTCXX := $(shell xcrun -sdk $(SDKPATH) -find c++)
ifeq "$(SDKPATH)" "/"
ifneq (,$(findstring XcodeDefault,$(HOSTCC)))
HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx Path)
else
HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx.internal Path)
endif
else
HOSTSDKPATH := $(SDKPATH)
endif
ISYSROOT:= -isysroot $(HOSTSDKPATH)
CC := $(HOSTCC)
CXX := $(HOSTCXX)
NM := $(shell xcrun -find nm)
STRIPCMD := $(shell xcrun -find strip)
else
HOSTCC := $(shell xcrun -sdk macosx -find cc)
HOSTCXX := $(shell xcrun -sdk macosx -find c++)
HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx Path)
ISYSROOT:= -isysroot $(SDKPATH)
CC := $(shell xcrun -sdk $(SDKPATH) -find cc)
CXX := $(shell xcrun -sdk $(SDKPATH) -find c++)
NM := $(shell xcrun -sdk $(SDKPATH) -find nm)
STRIPCMD := $(shell xcrun -sdk $(SDKPATH) -find strip)
endif
HOSTISYSROOT = -isysroot $(HOSTSDKPATH)
EMBEDDED:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3)
endif
DSYMTOOL := /usr/bin/dsymutil
DSYMSUFFIX := .dSYM
$(info # HOSTCC=$(HOSTCC))
$(info # HOSTCXX=$(HOSTCXX))
$(info # HOSTISYSROOT=$(HOSTISYSROOT))
$(info # CC=$(CC))
$(info # CXX=$(CXX))
$(info # ISYSROOT=$(ISYSROOT))
ifeq "$(EMBEDDED)" "1"
export APPLE_EMBEDDED=YES
DISABLE_DRAFT=YES
else ifeq "$(RC_INDIGO)" "YES"
export APPLE_EMBEDDED=YES
DISABLE_DRAFT=YES
else
export APPLE_EMBEDDED=NO
DISABLE_DRAFT=NO
endif
ifeq "$(APPLE_EMBEDDED)" "YES"
ICU_TARGET_VERSION := -miphoneos-version-min=$(IOS_VERSION_TARGET_STRING)
else
ICU_TARGET_VERSION :=
endif
$(info # ICU_TARGET_VERSION=$(ICU_TARGET_VERSION))
ifeq "$(DISABLE_DRAFT)" "YES"
DRAFT_FLAG=--disable-draft
else
DRAFT_FLAG=
endif
ifndef RC_ProjectSourceVersion
ifdef RC_PROJECTSOURCEVERSION
RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
endif
endif
# An Apple submission version (passed in RC_ProjectSourceVersion for official builds) is
# X[.Y[.Z]]
# where X is in range 0-214747, Y and Z are in range 0-99 (with no leading zeros).
# The value for the SourceVersion property in version.plists will be calculated as
# (X*10000 + Y*100 + Z). So we want U_ICU_VERSION_BUILDLEVEL_NUM to be Y*100 + Z
ifneq "$(RC_ProjectSourceVersion)" ""
ifeq "$(WINDOWS)" "YES"
ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
else
ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
endif
ifeq "$(ICU_BUILD_Y)" ""
ICU_BUILD := 0
else
ICU_BUILD := $(subst a,$(ICU_BUILD_Y),abc)
ifeq "$(ICU_BUILD_Z1)" ""
ICU_BUILD := $(subst b,0,$(ICU_BUILD))
ICU_BUILD := $(subst c,0,$(ICU_BUILD))
else
ifeq "$(ICU_BUILD_Z2)" ""
ICU_BUILD := $(subst b,0,$(ICU_BUILD))
ICU_BUILD := $(subst c,$(ICU_BUILD_Z1),$(ICU_BUILD))
else
ICU_BUILD := $(subst b,$(ICU_BUILD_Z1),$(ICU_BUILD))
ICU_BUILD := $(subst c,$(ICU_BUILD_Z2),$(ICU_BUILD))
endif
endif
endif
else
ICU_BUILD := 0
endif
$(info # ICU_BUILD=$(ICU_BUILD))
ifeq "$(ICU_BUILD)" "0"
DEFINE_BUILD_LEVEL =
else
DEFINE_BUILD_LEVEL =-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)
endif
# Disallow $(SRCROOT) == $(OBJROOT)
ifeq ($(OBJROOT), $(SRCROOT))
$(error SRCROOT same as OBJROOT)
endif
# Disallow cross builds on Windows/Linux for now
# (since those builds are not out-of-source as required for cross-builds)
ifeq "$(CROSS_BUILD)" "YES"
ifeq "$(WINDOWS)" "YES"
$(error Cross-builds currently not allowed on Windows)
endif
ifeq "$(LINUX)" "YES"
$(error Cross-builds currently not allowed on Linux)
endif
endif
#################################
# Headers
#################################
# For installhdrs. Not every compiled module has an associated header. Normally,
# ICU installs headers as a sub-targe of the install target. But since we only want
# certain libraries to install (and since we link all of our own .o modules), we need
# invoke the headers targets ourselves. This may be problematic because there isn't a
# good way to dist-clean afterwards...we need to do explicit dist-cleans, especially if
# install the extra libraries.
EXTRA_HDRS =
# EXTRA_HDRS = ./extra/ustdio/ ./layout/
ifeq "$(APPLE_EMBEDDED)" "YES"
HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
else ifeq "$(WINDOWS)" "YES"
HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
else
HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS)
endif
ifeq "$(WINDOWS)" "YES"
PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR)
else ifeq "$(APPLE_EMBEDDED)" "YES"
HDR_PREFIX=/usr
PRIVATE_HDR_PREFIX=/usr/local
else
PRIVATE_HDR_PREFIX=/usr/local
endif
#################################
# Install
#################################
# For install. We currently don't install EXTRA_LIBS. We also don't install the data
# directly into the ICU library. It is now installed at /usr/share/icu/*.dat. Thus we
# don't use DATA_OBJ anymore. This could change if we decide to move the data back into
# the icucore monolithic library.
INSTALL = /usr/bin/install
COMMON_OBJ = ./common/*.o
I18N_OBJ = ./i18n/*.o
IO_OBJ = ./io/*.o
STUB_DATA_OBJ = ./stubdata/*.o
EXTRA_LIBS =
#EXTRA_LIBS =./extra/ ./layout/ ./tools/ctestfw/ ./tools/toolutil/
#DATA_OBJ = ./data/out/build/*.o
ifeq "$(APPLE_EMBEDDED)" "YES"
DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(STUB_DATA_OBJ)
else ifeq "$(WINDOWS)" "YES"
DYLIB_OBJS=$(COMMON_OBJ) ./common/common.res $(I18N_OBJ) $(STUB_DATA_OBJ)
else
DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ)
endif
#################################
# Sources
#################################
# For installsrc (B&I)
# Note that installsrc is run on the system from which ICU is submitted, which
# may be a different environment than the one for a which a build is targeted.
INSTALLSRC_VARFILES=./ICU_embedded.order ./minimalapis.txt ./minimalapisTest.c ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt ./crosshostpatchconfig.txt
#################################
# Cleaning
#################################
#We need to clean after installing.
EXTRA_CLEAN =
# Some directories aren't cleaned recursively. Clean them manually...
MANUAL_CLEAN_TOOLS = ./tools/dumpce
MANUAL_CLEAN_EXTRA = ./extra/scrptrun ./samples/layout ./extra/ustdio ./extra
MANUAL_CLEAN_TEST = ./test/collperf ./test/iotest ./test/letest ./test/thaitest ./test/threadtest ./test/testmap ./test
MANUAL_CLEAN_SAMPLE = ./samples/layout ./samples
CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE)
#################################
# Config flags
#################################
ifeq "$(WINDOWS)" "YES"
ifeq "$(ARCH64)" "YES"
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
--with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
$(DRAFT_FLAG)
else
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
--with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
$(DRAFT_FLAG)
endif
else ifeq "$(LINUX)" "YES"
ifeq "$(ARCH64)" "YES"
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
--with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
$(DRAFT_FLAG)
else
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
--with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
$(DRAFT_FLAG)
endif
else ifeq "$(APPLE_EMBEDDED)" "YES"
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
--with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
$(DRAFT_FLAG)
else
CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
--with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
$(DRAFT_FLAG)
endif
#################################
# Install paths
#################################
# This may or may not be an appropriate name for the icu dylib. This naming scheme is
# an attempt to follow the icu convention in naming the dylib and then having symbolic
# links of easier to remember library names point it it. *UPDATE* the version and
# sub-version variables as needed. The Core version should be 'A' until the core
# version changes it's API...that is a new version isn't backwards compatible.
# The ICU version/subversion should reflect the actual ICU version.
LIB_NAME = icucore
ICU_VERS = 53
ICU_SUBVERS = 1
CORE_VERS = A
ifeq "$(WINDOWS)" "YES"
DYLIB_SUFF = dll
ifeq "$(ARCH64)" "YES"
winprogdir = /Program\ Files/Common\ Files/Apple/Apple\ Application\ Support/
winintlibdir = /AppleInternal/lib64/
else
winprogdir = /Program\ Files\ \(x86\)/Common\ Files/Apple/Apple\ Application\ Support/
winintlibdir = /AppleInternal/lib32/
endif
libdir =
else ifeq "$(LINUX)" "YES"
DYLIB_SUFF = so
ifeq "$(ARCH64)" "YES"
libdir = /usr/lib64/
else
libdir = /usr/lib/
endif
winprogdir =
winintlibdir =
else
DYLIB_SUFF = dylib
libdir = /usr/lib/
winprogdir =
winintlibdir =
endif
DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
ifeq "$(WINDOWS)" "YES"
INSTALLED_DYLIB = $(LIB_NAME).$(DYLIB_SUFF)
INSTALLED_DYLIB_DEBUG = $(LIB_NAME)_debug.$(DYLIB_SUFF)
INSTALLED_DYLIB_PROFILE = $(LIB_NAME)_profile.$(DYLIB_SUFF)
else ifeq "$(LINUX)" "YES"
INSTALLED_DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
else
INSTALLED_DYLIB = lib$(LIB_NAME).$(CORE_VERS).$(DYLIB_SUFF)
INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME).$(CORE_VERS)_debug.$(DYLIB_SUFF)
INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME).$(CORE_VERS)_profile.$(DYLIB_SUFF)
endif
INSTALLED_DYLIB_icu = INSTALLED_DYLIB
INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG
INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE
DYLIB_icu = DYLIB
DYLIB_debug = DYLIB_DEBUG
DYLIB_profile = DYLIB_PROFILE
#################################
# Data files
#################################
OPEN_SOURCE_VERSIONS_DIR=/usr/local/OpenSourceVersions/
OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/
B_DATA_FILE=icudt$(ICU_VERS)b.dat
L_DATA_FILE=icudt$(ICU_VERS)l.dat
DATA_BUILD_SUBDIR= data/out
DATA_INSTALL_DIR=/usr/share/icu/
# DATA_LOOKUP_DIR is what the target ICU_DATA_DIR gets set to in CFLAGS, CXXFLAGS;
# DATA_LOOKUP_DIR_BUILDHOST is what any crossbuild host ICU_DATA_DIR gets set to.
ifneq "$(APPLE_EMBEDDED)" "YES"
DATA_LOOKUP_DIR=/usr/share/icu/
else
ifeq "$(RC_INDIGO)" "YES"
DATA_LOOKUP_DIR=/usr/share/icu/
else
DATA_LOOKUP_DIR=/var/db/icu/
endif
endif
DATA_LOOKUP_DIR_BUILDHOST=/usr/share/icu/
# Name of runtime environment variable to get the prefix path for DATA_LOOKUP_DIR
# Currently we are only using this for LINUX, should also use for iOS simulator
ifeq "$(LINUX)" "YES"
DATA_DIR_PREFIX_ENV_VAR=APPLE_FRAMEWORKS_ROOT
else
DATA_DIR_PREFIX_ENV_VAR=
endif
#################################
# Info tool
#################################
localtooldir=/usr/local/bin/
INFOTOOL = icuinfo
INFOTOOL_OBJS = ./tools/icuinfo/icuinfo.o ./tools/toolutil/udbgutil.o ./tools/toolutil/uoptions.o
#################################
# CLDR file(s)
# e.g. supplementalData.xml, per <rdar://problem/13426014>
# These are like internal headers in that they are only installed for
# (other) projects to build against, not needed at runtime.
# Therefore install during installhdrs.
#################################
CLDRFILESDIR=/usr/local/share/cldr
#################################
# Environment variables
#################################
# $(RC_ARCHS:%=-arch %) is a substitution reference. It denotes, in this case,
# for every value <val> in RC_ARCHS, replace it with "-arch <val>". Substitution
# references have the form $(var:a=b). We can insert the strip and prebinding commands
# into CFLAGS (and CXXFLAGS). This controls a lot of the external variables so we don't
# need to directly modify the ICU files (like for CFLAGS, etc).
LIBOVERRIDES=LIBICUDT="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
LIBICUUC="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
LIBICUI18N="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)"
# For normal Windows builds set the ENV= options here; for debug Windows builds set the ENV_DEBUG=
# options here and also the update the LINK.EXE lines in the TARGETS section below.
ifeq "$(WINDOWS)" "YES"
ifeq "$(ARCH64)" "YES"
ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
LDFLAGS="/NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF"
else
ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
LDFLAGS="/NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF"
endif
ENV_CONFIGURE= CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
CFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
CXXFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t"
ENV_DEBUG= CFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
CXXFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc" \
LDFLAGS="/DEBUG /DYNAMICBASE"
ENV_PROFILE=
else ifeq "$(LINUX)" "YES"
ifeq "$(ARCH64)" "YES"
ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
else
ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
endif
else
CPPOPTIONS =
ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(ISYSROOT) $(ENV_CONFIGURE_ARCHS)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
RC_ARCHS="$(RC_ARCHS)" $(FORCEENDIAN)\
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
RC_ARCHS="$(RC_ARCHS)" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
RC_ARCHS="$(RC_ARCHS)" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
RC_ARCHS="$(RC_ARCHS)" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_CONFIGURE_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(HOSTISYSROOT)" \
CC="$(HOSTCC)" \
CXX="$(HOSTCXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
ENV_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
CC="$(HOSTCC)" \
CXX="$(HOSTCXX)" \
CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
TZDATA="$(TZDATA)" \
DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
endif
ENV_icu = ENV
ENV_debug = ENV_DEBUG
ENV_profile = ENV_PROFILE
ifeq "$(BUILD_TYPE)" "DEVICE"
ORDERFILE=$(SDKPATH)/AppleInternal/OrderFiles/libicucore.order
else ifeq "$(APPLE_EMBEDDED)" "YES"
ORDERFILE=$(SRCROOT)/ICU_embedded.order
else
ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order
endif
ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES"
SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE)
else
SECTORDER_FLAGS=
endif
#################################
#################################
# TARGETS
#################################
#################################
.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install crossbuildhost
.DELETE_ON_ERROR :
icu debug profile : $(OBJROOT_CURRENT)/Makefile
echo "# make for target";
(cd $(OBJROOT_CURRENT); \
$(MAKE) $($(ENV_$@)); \
if test "$(WINDOWS)" = "YES"; then \
(cd common; \
rc.exe /folibicuuc.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
"-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 libicuuc.rc; \
); \
(cd i18n; \
rc.exe /folibicuin.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common libicuin.rc; \
); \
if test "$@" = "debug"; then \
(cd common; \
LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a800000" /DYNAMICBASE /DEBUG \
/IMPLIB:../lib/[email protected] /out:../lib/[email protected] \
*.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
); \
(cd i18n; \
LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a900000" /DYNAMICBASE /DEBUG \
/IMPLIB:../lib/[email protected] /out:../lib/[email protected] \
*.o libicuin.res ../lib/[email protected] ../stubdata/icudt.lib advapi32.lib; \
); \
else \
(cd common; \
rm -f ../lib/libicuuc.dll.manifest; \
if test "$(ARCH64)" = "YES"; then \
LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
*.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
else \
LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
*.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
fi; \
mt.exe -nologo -manifest ../lib/libicuuc.dll.manifest -outputresource:"../lib/libicuuc.dll;2"; \
); \
(cd i18n; \
rm -f ../lib/libicuin.dll.manifest; \
if test "$(ARCH64)" = "YES"; then \
LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
*.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
else \
LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
*.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
fi; \
mt.exe -nologo -manifest ../lib/libicuin.dll.manifest -outputresource:"../lib/libicuin.dll;2"; \
); \
if test "$(ARCH64)" != "YES"; then \
mkdir -p lib/shim; \
(cd common; \
rm -f icuuc40shim.o; \
rm -f ../lib/icuuc40.dll.manifest; \
cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
-DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
-DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_COMMON_IMPLEMENTATION \
/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
/c /Foicuuc40shim.o icuuc40shim.cpp; \
rc.exe /foicuuc40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
"-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuuc40shim.rc; \
LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/shim/icuuc.lib /out:../lib/icuuc40.dll \
icuuc40shim.o icuuc40shim.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
mt.exe -nologo -manifest ../lib/icuuc40.dll.manifest -outputresource:"../lib/icuuc40.dll;2"; \
); \
(cd i18n; \
rm -f icuin40shim.o; \
rm -f ../lib/icuin40.dll.manifest; \
cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
-DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
-DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_I18N_IMPLEMENTATION \
/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
/c /Foicuin40shim.o icuin40shim.cpp; \
rc.exe /foicuin40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
"-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuin40shim.rc; \
LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
/IMPLIB:../lib/shim/icuin.lib /out:../lib/icuin40.dll \
icuin40shim.o icuin40shim.res ../lib/libicuin.lib ../stubdata/icudt.lib advapi32.lib; \
mt.exe -nologo -manifest ../lib/icuin40.dll.manifest -outputresource:"../lib/icuin40.dll;2"; \
); \
fi; \
fi; \
else \
if test "$(LINUX)" = "YES"; then \
if test "$(ARCH64)" = "YES"; then \
$($(ENV_$@)) $(CXX) \
-m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
$(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -Wl,-L/usr/lib64/ -ldl \
-o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
else \
$($(ENV_$@)) $(CXX) \
-m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
$(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -ldl \
-o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
fi; \
else \
tmpfile=`mktemp -t weakexternal.XXXXXX` || exit 1; \
$(NM) -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \
$($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
$(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
$(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
-install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
if test "$@" = "icu"; then \
ln -fs $(INSTALLED_DYLIB) $(DYLIB); \
$($(ENV_$@)) $(CXX) $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
$(LDFLAGS) -dead_strip -o ./$(INFOTOOL) $(INFOTOOL_OBJS) -L./ -l$(LIB_NAME) ; \
fi; \
fi; \
if test -f ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); then \
ln -fs ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); \
fi; \
if test -f ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); then \
ln -fs ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); \
else \
DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
$(ICUPKGTOOL) -tl ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
fi; \
fi; \
);
crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
echo "# make for crossbuild host";
(cd $(CROSSHOST_OBJROOT); \
$(MAKE) $($(ENV_BUILDHOST)); \
);
check : icu
ifneq "$(CROSS_BUILD)" "YES"
(cd $(OBJROOT_CURRENT); \
ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV) check; \
);
else
$(warning check not supported for cross-build)
endif
check-debug: debug
ifneq "$(CROSS_BUILD)" "YES"
(cd $(OBJROOT_CURRENT); \
ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV_DEBUG) check; \
);
else
$(warning check not supported for cross-build)
endif
samples: icu
(cd $(OBJROOT_CURRENT)/samples; \
$(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
);
extra: icu
(cd $(OBJROOT_CURRENT)/extra; \
$(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
);
ifneq "$(CROSS_BUILD)" "YES"
$(OBJROOT_CURRENT)/Makefile :
else
$(OBJROOT_CURRENT)/Makefile : crossbuildhost
endif
if test ! -d $(OBJROOT_CURRENT); then \
mkdir -p $(OBJROOT_CURRENT); \
fi;
cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT_CURRENT)/;
if test "$(WINDOWS)" = "YES"; then \
echo "# configure for target"; \
(cd $(OBJROOT_CURRENT)/data/unidata; mv base_unidata/*.txt .;); \
(cd $(OBJROOT_CURRENT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
(cd $(OBJROOT_CURRENT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
(cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS);) \
elif test "$(LINUX)" = "YES"; then \
echo "# configure for target"; \
(cd $(OBJROOT_CURRENT)/data/unidata; mv base_unidata/*.txt .;); \
(cd $(OBJROOT_CURRENT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
(cd $(OBJROOT_CURRENT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
(cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU Linux $(CONFIG_FLAGS);) \
elif test "$(CROSS_BUILD)" = "YES"; then \
echo "# configure for crossbuild target"; \
(cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./configure --host=$(TARGET_SPEC) --with-cross-build=$(CROSSHOST_OBJROOT) $(CONFIG_FLAGS);) \
else \
echo "# configure for non-crossbuild target"; \
(cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU MacOSX $(CONFIG_FLAGS);) \
fi;
if test "$(APPLE_EMBEDDED)" = "YES"; then \
(cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/minimalpatchconfig.txt;) \
elif test "$(WINDOWS)" = "YES"; then \
(cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/windowspatchconfig.txt;) \
else \
(cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/patchconfig.txt;) \
fi; \
# for the tools that build the data file, cannot set UDATA_DEFAULT_ACCESS = UDATA_ONLY_PACKAGES
# as minimalpatchconfig.txt does; need different patches for the host build.
$(CROSSHOST_OBJROOT)/Makefile :
if test ! -d $(CROSSHOST_OBJROOT); then \
mkdir -p $(CROSSHOST_OBJROOT); \
fi;
cp -Rpf $(SRCROOT)/icuSources/* $(CROSSHOST_OBJROOT);
echo "# configure for crossbuild host";
(cd $(CROSSHOST_OBJROOT); $(ENV_CONFIGURE_BUILDHOST) ./runConfigureICU MacOSX $(CONFIG_FLAGS);)
(cd $(CROSSHOST_OBJROOT)/common/unicode/; patch <$(SRCROOT)/crosshostpatchconfig.txt;)