]>
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 | |
b75a7d8f | 4 | ## Aix-specific setup (for Visual Age 5+) |
729e4ab9 | 5 | ## Copyright (c) 1999-2010, International Business Machines Corporation and |
b75a7d8f | 6 | ## others. All Rights Reserved. |
b75a7d8f A |
7 | |
8 | ## Commands to generate dependency files | |
9 | GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS) | |
10 | GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS) | |
11 | ||
12 | # -qroconst make the strings readonly, which is usually the default. | |
13 | # This helps in the data library, | |
14 | # -qproto assumes all functions are prototyped (for optimization) | |
729e4ab9 | 15 | # -qrtti turns on compiler RTTI, required beginning with ICU 4.6 |
f3c0d7a5 A |
16 | CFLAGS += -qproto -qroconst -qlanglvl=extended |
17 | CXXFLAGS += -qproto -qroconst -qrtti -qlanglvl=extended0x | |
b75a7d8f | 18 | |
374ca955 A |
19 | # If you readd this line, you must change the SO value |
20 | #LDFLAGS += -brtl | |
b75a7d8f | 21 | |
729e4ab9 A |
22 | ifeq ($(UCLN_NO_AUTO_CLEANUP),0) |
23 | # set up init point. | |
24 | UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) | |
25 | CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) | |
26 | LDFLAGS_FINI = -binitfini::$(UCLN_FINI) | |
27 | ||
28 | CPPFLAGSICUUC += $(CPPFLAGS_FINI) | |
29 | LDFLAGSICUUC += $(LDFLAGS_FINI) | |
30 | CPPFLAGSICUIO += $(CPPFLAGS_FINI) | |
31 | LDFLAGSICUIO += $(LDFLAGS_FINI) | |
32 | CPPFLAGSICUI18N += $(CPPFLAGS_FINI) | |
33 | LDFLAGSICUI18N += $(LDFLAGS_FINI) | |
34 | CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) | |
35 | LDFLAGSCTESTFW += $(LDFLAGS_FINI) | |
36 | ||
37 | # ICUUC, ICUIO, ICUI18N, CTESTFW | |
38 | endif | |
39 | ||
b75a7d8f A |
40 | ## We need to delete things prior to linking, or else we'll get |
41 | ## SEVERE ERROR: output file in use .. on AIX. | |
42 | ## But, shell script version should NOT delete target as we don't | |
43 | ## have $@ in that context. (SH = only shell script, icu-config) | |
44 | AIX_PREDELETE=rm -f $@ ; | |
45 | #SH# AIX_PREDELETE= | |
46 | ||
47 | ## Commands to link | |
48 | ## We need to use the C++ linker, even when linking C programs, since | |
49 | ## our libraries contain C++ code (C++ static init not called) | |
50 | LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
51 | LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
52 | ||
53 | ## Commands to make a shared library | |
54 | ## -G means -berok -brtl -bnortllib -bnosymbolic -bnoautoexp | |
55 | ## -bh:8 means halt on errors or worse. We don't display warnings about | |
56 | ## duplicate inline symbols. | |
57 | SHLIB.c= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) | |
58 | SHLIB.cc= $(AIX_PREDELETE) $(CXX) -qmkshrobj -G $(LDFLAGS) | |
59 | ||
60 | ## Compiler switch to embed a runtime search path | |
61 | LD_RPATH= -I | |
62 | LD_RPATH_PRE= | |
63 | ||
64 | ## Environment variable to set a runtime search path | |
65 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
66 | ||
b75a7d8f A |
67 | # The following is for Makefile.inc's use. |
68 | ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) | |
69 | ||
70 | # this one is for icudefs.mk's use | |
374ca955 | 71 | ifeq ($(ENABLE_SHARED),YES) |
b75a7d8f | 72 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) |
374ca955 | 73 | endif |
b75a7d8f A |
74 | |
75 | LD_SONAME = | |
76 | ||
374ca955 A |
77 | ## The type of assembly needed when pkgdata is used for generating shared libraries. |
78 | GENCCODE_ASSEMBLY=-a xlc | |
79 | ||
b75a7d8f | 80 | ## Shared object suffix |
73c04bcf | 81 | SOBJ= so |
374ca955 A |
82 | # without the -brtl option, the library names use .a. AIX is funny that way. |
83 | SO= a | |
b75a7d8f A |
84 | ## Non-shared intermediate object suffix |
85 | STATIC_O = o | |
86 | ||
73c04bcf A |
87 | ## Override Versioned target for a shared library. |
88 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
89 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
90 | SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ))) | |
729e4ab9 | 91 | SHARED_OBJECT_NO_VERSION= $(basename $(SO_TARGET)).$(SOBJ) |
73c04bcf | 92 | |
b75a7d8f A |
93 | ## Build archive from shared object |
94 | %.a : %.so | |
729e4ab9 A |
95 | ln -f $< $(SHARED_OBJECT_NO_VERSION) |
96 | $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) | |
97 | rm -f $(SHARED_OBJECT_NO_VERSION) | |
73c04bcf | 98 | $(LIBDIR)/%.a : %.so |
729e4ab9 A |
99 | ln -f $< $(SHARED_OBJECT_NO_VERSION) |
100 | $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION) | |
101 | rm -f $(SHARED_OBJECT_NO_VERSION) | |
b75a7d8f A |
102 | |
103 | ## Build import list from export list | |
104 | %.e : %.exp | |
105 | @echo "Building an import list for $<" | |
106 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
107 | ||
108 | ## Compilation rules | |
109 | %.$(STATIC_O): $(srcdir)/%.c | |
110 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
111 | %.o: $(srcdir)/%.c | |
112 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
113 | ||
f3c0d7a5 A |
114 | |
115 | ## C++ compilation rules. | |
116 | ||
117 | # This causes escapesrc to be built before other ICU targets. | |
118 | NEED_ESCAPING=YES | |
119 | ||
120 | ifneq ($(SKIP_ESCAPING),) | |
121 | # no escaping - bootstrap | |
b75a7d8f A |
122 | %.o: $(srcdir)/%.cpp |
123 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
f3c0d7a5 A |
124 | else |
125 | # convert *.cpp files to _*.cpp with \u / \U escaping | |
126 | CLEANFILES += _*.cpp | |
b75a7d8f | 127 | |
f3c0d7a5 A |
128 | # the actual escaping |
129 | _%.cpp: $(srcdir)/%.cpp | |
130 | @$(BINDIR)/escapesrc$(EXEEXT) $< $@ | |
131 | ||
132 | # compilation for static obj | |
133 | %.$(STATIC_O): _%.cpp | |
134 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
135 | # compilation for dynamic obj | |
136 | %.o: _%.cpp | |
137 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
138 | endif | |
b75a7d8f A |
139 | |
140 | ## Dependency rules | |
141 | %.d : %.u | |
142 | @$(SHELL) -ec 'cat $< \ | |
143 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
144 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
145 | ||
146 | %.u : $(srcdir)/%.c | |
147 | @echo "generating dependency information for $<" | |
4388f060 | 148 | @$(GEN_DEPS.c) $< > /dev/null |
b75a7d8f A |
149 | |
150 | %.u : $(srcdir)/%.cpp | |
151 | @echo "generating dependency information for $<" | |
4388f060 | 152 | @$(GEN_DEPS.cc) $< > /dev/null |
b75a7d8f A |
153 | |
154 | ## Versioned libraries rules | |
155 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 156 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 157 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 158 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f A |
159 | |
160 | ## End Aix-specific setup |