2 ## Aix-specific setup (for Visual Age 5+)
3 ## Copyright (c) 1999-2010, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
7 GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS)
8 GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS)
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)
13 # -qrtti turns on compiler RTTI, required beginning with ICU 4.6
14 CFLAGS += -qproto -qroconst
15 CXXFLAGS += -qproto -qroconst -qrtti
17 # If you readd this line, you must change the SO value
20 ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
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)
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)
35 # ICUUC, ICUIO, ICUI18N, CTESTFW
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 $@ ;
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)
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)
58 ## Compiler switch to embed a runtime search path
62 ## Environment variable to set a runtime search path
63 LDLIBRARYPATH_ENVVAR = LIBPATH
65 # The following is for Makefile.inc's use.
66 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
68 # this one is for icudefs.mk's use
69 ifeq ($(ENABLE_SHARED),YES)
70 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
75 ## The type of assembly needed when pkgdata is used for generating shared libraries.
76 GENCCODE_ASSEMBLY=-a xlc
78 ## Shared object suffix
80 # without the -brtl option, the library names use .a. AIX is funny that way.
82 ## Non-shared intermediate object suffix
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)))
89 SHARED_OBJECT_NO_VERSION= $(basename $(SO_TARGET)).$(SOBJ)
91 ## Build archive from shared object
93 ln -f $< $(SHARED_OBJECT_NO_VERSION)
94 $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
95 rm -f $(SHARED_OBJECT_NO_VERSION)
97 ln -f $< $(SHARED_OBJECT_NO_VERSION)
98 $(AIX_PREDELETE) $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
99 rm -f $(SHARED_OBJECT_NO_VERSION)
101 ## Build import list from export list
103 @echo "Building an import list for $<"
104 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
107 %.$(STATIC_O): $(srcdir)/%.c
108 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
110 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
112 %.$(STATIC_O): $(srcdir)/%.cpp
113 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
115 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
120 @$(SHELL) -ec 'cat $< \
121 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
122 [ -s $@ ] || rm -f $@ ; rm -f $<'
125 @echo "generating dependency information for $<"
126 @$(GEN_DEPS.c) $< > /dev/null
128 %.u : $(srcdir)/%.cpp
129 @echo "generating dependency information for $<"
130 @$(GEN_DEPS.cc) $< > /dev/null
132 ## Versioned libraries rules
133 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
134 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
135 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
136 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
138 ## End Aix-specific setup