]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/mh-solaris
ICU-59117.0.1.tar.gz
[apple/icu.git] / icuSources / config / mh-solaris
CommitLineData
b75a7d8f 1## -*-makefile-*-
f3c0d7a5
A
2## Copyright (C) 2016 and later: Unicode, Inc. and others.
3## License & terms of use: http://www.unicode.org/copyright.html
73c04bcf 4## Solaris-specific setup using Sun's compilers
729e4ab9 5## Copyright (c) 1999-2010, International Business Machines Corporation and
b75a7d8f 6## others. All Rights Reserved.
b75a7d8f 7
f3c0d7a5
A
8## Flags for ICU 59+
9CXXFLAGS += -std=c++11
10CFLAGS += -std=c99
11
b75a7d8f
A
12## Flags for position independent code
13SHAREDLIBCFLAGS = -KPIC
14SHAREDLIBCXXFLAGS = -KPIC
15SHAREDLIBCPPFLAGS = -DPIC
16
17## Commands to generate dependency files
18GEN_DEPS.c= $(CC) -xM $(DEFS) $(CPPFLAGS)
19GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS)
20
729e4ab9
A
21ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
22# set up init point.
23UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME)
24CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI)
25LDFLAGS_FINI = -zfiniarray=$(UCLN_FINI)
26
27CPPFLAGSICUUC += $(CPPFLAGS_FINI)
28LDFLAGSICUUC += $(LDFLAGS_FINI)
29CPPFLAGSICUIO += $(CPPFLAGS_FINI)
30LDFLAGSICUIO += $(LDFLAGS_FINI)
31CPPFLAGSICUI18N += $(CPPFLAGS_FINI)
32LDFLAGSICUI18N += $(LDFLAGS_FINI)
33CPPFLAGSCTESTFW += $(CPPFLAGS_FINI)
34LDFLAGSCTESTFW += $(LDFLAGS_FINI)
35
36# ICUUC, ICUIO, ICUI18N, CTESTFW
37endif
38
b75a7d8f 39# -mt means 'compiles and links a multithreaded program'
374ca955
A
40THREADSCFLAGS += -mt
41THREADSCXXFLAGS += -mt
b75a7d8f
A
42
43## Commands to link
44## For Sun Workshop, use CC to link to bring in C++ runtime
45LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
46LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
47
48## Commands to make a shared library
49SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G
50SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G
51
52## Compiler switch to embed a runtime search path
729e4ab9
A
53LD_RPATH= -R'$$'ORIGIN
54LD_RPATH_PRE= -R
b75a7d8f 55
73c04bcf
A
56#LIBRARY_PATH_PREFIX=/usr/lib/lwp:
57
b75a7d8f 58## Compiler switch to embed a library name
374ca955
A
59LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET))
60
b75a7d8f
A
61## Shared object suffix
62SO= so
63## Non-shared intermediate object suffix
64STATIC_O = o
65
f3c0d7a5
A
66# This causes escapesrc to be built before other ICU targets.
67NEED_ESCAPING=YES
68
b75a7d8f
A
69## Compilation rules
70%.$(STATIC_O): $(srcdir)/%.c
71 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
72%.o: $(srcdir)/%.c
73 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
74
f3c0d7a5 75ifneq ($(SKIP_ESCAPING),)
b75a7d8f
A
76%.o: $(srcdir)/%.cpp
77 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
f3c0d7a5
A
78%.$(STATIC_O): $(srcdir)/%.cpp
79 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
80else
81# convert *.cpp files to _*.cpp with \u / \U escaping
82CLEANFILES += _*.cpp
83
84# the actual escaping
85_%.cpp: $(srcdir)/%.cpp
86 @$(BINDIR)/escapesrc$(EXEEXT) $< $@
b75a7d8f 87
f3c0d7a5
A
88# no escaping - bootstrap
89%.$(STATIC_O): _%.cpp
90 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
91%.o: _%.cpp
92 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
93endif
b75a7d8f
A
94
95## Dependency rules
96%.d : $(srcdir)/%.c
97 @echo "generating dependency information for $<"
98 @$(GEN_DEPS.c) $< > $@
99
100%.d : $(srcdir)/%.cpp
101 @echo "generating dependency information for $<"
102 @$(GEN_DEPS.cc) $< > $@
103
104## Versioned libraries rules
105
106%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
374ca955 107 $(RM) $@ && ln -s ${<F} $@
b75a7d8f 108%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
374ca955 109 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
b75a7d8f
A
110
111#
374ca955 112ifeq (strip $(GENCCODE_ASSEMBLY),)
b75a7d8f 113BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate
b75a7d8f 114BIR_DEPS= $(NAME).map
374ca955
A
115endif
116
729e4ab9
A
117## Remove shared library 's'
118STATIC_PREFIX_WHEN_USED =
119STATIC_PREFIX =
120
b75a7d8f 121## End Solaris-specific setup