2 ## Aix-specific setup (for xlC)
3 ## Copyright (c) 1999-2004, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability).
7 ## So, we are using 'windows' style library names, that is, libicuuc20.1.so instead of libicuuc.so.20.1
9 ## Commands to generate dependency files
10 GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS)
11 GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS)
13 # Make the strings readonly. This helps in the common data library
19 ## We need to delete things prior to linking, or else we'll get
20 ## SEVERE ERROR: output file in use .. on AIX.
21 ## But, shell script version should NOT delete target as we don't
22 ## have $@ in that context. (SH = only shell script, icu-config)
23 AIX_PREDELETE=rm -f $@ ;
28 ## We need to use the C++ linker, even when linking C programs, since
29 ## our libraries contain C++ code (C++ static init not called)
30 LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
31 LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
33 ## Commands to make a shared library
34 SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS)
35 SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS)
37 ## Compiler switch to embed a runtime search path
41 ## Environment variable to set a runtime search path
42 LDLIBRARYPATH_ENVVAR = LIBPATH
44 ## Override Versioned target for a shared library.
45 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
46 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
48 # The following is for Makefile.inc's use.
49 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
51 # this one is for icudefs.mk's use
52 ifeq ($(ENABLE_SHARED),YES)
53 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
56 ## Compiler switch to embed a library name. Not present on AIX.
59 ## Shared object suffix
62 ## Non-shared intermediate object suffix
67 ## Build archive from shared object
69 $(AR) $(ARFLAGS) $@ $<
71 ## Build import list from export list
73 @echo "Building an import list for $<"
74 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
77 %.$(STATIC_O): $(srcdir)/%.c
78 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
80 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
82 %.$(STATIC_O): $(srcdir)/%.cpp
83 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
85 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
90 @$(SHELL) -ec 'cat $< \
91 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
92 [ -s $@ ] || rm -f $@ ; rm -f $<'
95 @echo "generating dependency information for $<"
96 @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null'
99 @echo "generating dependency information for $<"
100 @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null'
103 ## Versioned libraries rules
104 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
105 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
106 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
107 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
110 ## BIR - bind with internal references [so app data and icu data doesn't collide]
111 BIR_LDFLAGS= -E$(NAME).map -bnoexpall
112 BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
113 BIR_DEPS= $(NAME).map
116 ## End Aix-specific setup