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