]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## Copyright (C) 2016 and later: Unicode, Inc. and others. | |
3 | ## License & terms of use: http://www.unicode.org/copyright.html | |
4 | ## Solaris-specific setup using Sun's compilers | |
5 | ## Copyright (c) 1999-2010, International Business Machines Corporation and | |
6 | ## others. All Rights Reserved. | |
7 | ||
8 | ## Flags for ICU 59+ | |
9 | CXXFLAGS += -std=c++11 | |
10 | CFLAGS += -std=c99 | |
11 | ||
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 | ||
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 | ||
39 | # -mt means 'compiles and links a multithreaded program' | |
40 | THREADSCFLAGS += -mt | |
41 | THREADSCXXFLAGS += -mt | |
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 | |
53 | LD_RPATH= -R'$$'ORIGIN | |
54 | LD_RPATH_PRE= -R | |
55 | ||
56 | #LIBRARY_PATH_PREFIX=/usr/lib/lwp: | |
57 | ||
58 | ## Compiler switch to embed a library name | |
59 | LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) | |
60 | ||
61 | ## Shared object suffix | |
62 | SO= so | |
63 | ## Non-shared intermediate object suffix | |
64 | STATIC_O = o | |
65 | ||
66 | # This causes escapesrc to be built before other ICU targets. | |
67 | NEED_ESCAPING=YES | |
68 | ||
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 | ||
75 | ifneq ($(SKIP_ESCAPING),) | |
76 | %.o: $(srcdir)/%.cpp | |
77 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
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) $< $@ | |
87 | ||
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 | |
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) | |
107 | $(RM) $@ && ln -s ${<F} $@ | |
108 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) | |
109 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ | |
110 | ||
111 | # | |
112 | ifeq (strip $(GENCCODE_ASSEMBLY),) | |
113 | BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate | |
114 | BIR_DEPS= $(NAME).map | |
115 | endif | |
116 | ||
117 | ## Remove shared library 's' | |
118 | STATIC_PREFIX_WHEN_USED = | |
119 | STATIC_PREFIX = | |
120 | ||
121 | ## End Solaris-specific setup |