]>
Commit | Line | Data |
---|---|---|
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+ |
9 | CXXFLAGS += -std=c++11 | |
10 | CFLAGS += -std=c99 | |
11 | ||
b75a7d8f A |
12 | ## Flags for position independent code |
13 | SHAREDLIBCFLAGS = -KPIC | |
14 | SHAREDLIBCXXFLAGS = -KPIC | |
15 | SHAREDLIBCPPFLAGS = -DPIC | |
16 | ||
17 | ## Commands to generate dependency files | |
18 | GEN_DEPS.c= $(CC) -xM $(DEFS) $(CPPFLAGS) | |
19 | GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS) | |
20 | ||
729e4ab9 A |
21 | ifeq ($(UCLN_NO_AUTO_CLEANUP),0) |
22 | # set up init point. | |
23 | UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) | |
24 | CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) | |
25 | LDFLAGS_FINI = -zfiniarray=$(UCLN_FINI) | |
26 | ||
27 | CPPFLAGSICUUC += $(CPPFLAGS_FINI) | |
28 | LDFLAGSICUUC += $(LDFLAGS_FINI) | |
29 | CPPFLAGSICUIO += $(CPPFLAGS_FINI) | |
30 | LDFLAGSICUIO += $(LDFLAGS_FINI) | |
31 | CPPFLAGSICUI18N += $(CPPFLAGS_FINI) | |
32 | LDFLAGSICUI18N += $(LDFLAGS_FINI) | |
33 | CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) | |
34 | LDFLAGSCTESTFW += $(LDFLAGS_FINI) | |
35 | ||
36 | # ICUUC, ICUIO, ICUI18N, CTESTFW | |
37 | endif | |
38 | ||
b75a7d8f | 39 | # -mt means 'compiles and links a multithreaded program' |
374ca955 A |
40 | THREADSCFLAGS += -mt |
41 | THREADSCXXFLAGS += -mt | |
b75a7d8f A |
42 | |
43 | ## Commands to link | |
44 | ## For Sun Workshop, use CC to link to bring in C++ runtime | |
45 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
46 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
47 | ||
48 | ## Commands to make a shared library | |
49 | SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G | |
50 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G | |
51 | ||
52 | ## Compiler switch to embed a runtime search path | |
729e4ab9 A |
53 | LD_RPATH= -R'$$'ORIGIN |
54 | LD_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 |
59 | LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) |
60 | ||
b75a7d8f A |
61 | ## Shared object suffix |
62 | SO= so | |
63 | ## Non-shared intermediate object suffix | |
64 | STATIC_O = o | |
65 | ||
f3c0d7a5 A |
66 | # This causes escapesrc to be built before other ICU targets. |
67 | NEED_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 | 75 | ifneq ($(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 $@ $< | |
80 | else | |
81 | # convert *.cpp files to _*.cpp with \u / \U escaping | |
82 | CLEANFILES += _*.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 $@ $< | |
93 | endif | |
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 | 112 | ifeq (strip $(GENCCODE_ASSEMBLY),) |
b75a7d8f | 113 | BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate |
b75a7d8f | 114 | BIR_DEPS= $(NAME).map |
374ca955 A |
115 | endif |
116 | ||
729e4ab9 A |
117 | ## Remove shared library 's' |
118 | STATIC_PREFIX_WHEN_USED = | |
119 | STATIC_PREFIX = | |
120 | ||
b75a7d8f | 121 | ## End Solaris-specific setup |