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.
12 ## Flags for position independent code
13 SHAREDLIBCFLAGS = -KPIC
14 SHAREDLIBCXXFLAGS = -KPIC
15 SHAREDLIBCPPFLAGS = -DPIC
17 ## Commands to generate dependency files
18 GEN_DEPS.c= $(CC) -xM $(DEFS) $(CPPFLAGS)
19 GEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS)
21 ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
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)
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)
36 # ICUUC, ICUIO, ICUI18N, CTESTFW
39 # -mt means 'compiles and links a multithreaded program'
41 THREADSCXXFLAGS += -mt
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)
48 ## Commands to make a shared library
49 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -G
50 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -G
52 ## Compiler switch to embed a runtime search path
53 LD_RPATH= -R'$$'ORIGIN
56 #LIBRARY_PATH_PREFIX=/usr/lib/lwp:
58 ## Compiler switch to embed a library name
59 LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)
61 ## Shared object suffix
63 ## Non-shared intermediate object suffix
66 # This causes escapesrc to be built before other ICU targets.
70 %.$(STATIC_O): $(srcdir)/%.c
71 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
73 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
75 ifneq ($(SKIP_ESCAPING),)
77 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
78 %.$(STATIC_O): $(srcdir)/%.cpp
79 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
81 # convert *.cpp files to _*.cpp with \u / \U escaping
85 _%.cpp: $(srcdir)/%.cpp
86 @$(BINDIR)/escapesrc$(EXEEXT) $< $@
88 # no escaping - bootstrap
90 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
92 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
97 @echo "generating dependency information for $<"
98 @$(GEN_DEPS.c) $< > $@
100 %.d : $(srcdir)/%.cpp
101 @echo "generating dependency information for $<"
102 @$(GEN_DEPS.cc) $< > $@
104 ## Versioned libraries rules
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) $@
112 ifeq (strip $(GENCCODE_ASSEMBLY),)
113 BIR_LDFLAGS= -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate
114 BIR_DEPS= $(NAME).map
117 ## Remove shared library 's'
118 STATIC_PREFIX_WHEN_USED =
121 ## End Solaris-specific setup