2 ## Aix-specific setup (for xlC)
3 ## Copyright (c) 1999-2002, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-aix,v 1.1.1.2 2003/07/03 18:13:33 avery Exp $
8 ## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability).
9 ## So, we are using 'windows' style library names, that is, libicuuc20.1.so instead of libicuuc.so.20.1
11 ## Commands to generate dependency files
12 GEN_DEPS.c= $(CC) -E -M $(DEFS) $(CPPFLAGS)
13 GEN_DEPS.cc= $(CXX) -E -M $(DEFS) $(CPPFLAGS)
15 # Make the strings readonly. This helps in the common data library
21 ## We need to delete things prior to linking, or else we'll get
22 ## SEVERE ERROR: output file in use .. on AIX.
23 ## But, shell script version should NOT delete target as we don't
24 ## have $@ in that context. (SH = only shell script, icu-config)
25 AIX_PREDELETE=rm -f $@ ;
30 ## We need to use the C++ linker, even when linking C programs, since
31 ## our libraries contain C++ code (C++ static init not called)
32 LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
33 LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
35 ## Commands to make a shared library
36 SHLIB.c= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS)
37 SHLIB.cc= $(AIX_PREDELETE) $(AIX_SHLIB) -p 5000 $(LDFLAGS)
39 ## Compiler switch to embed a runtime search path
43 ## Environment variable to set a runtime search path
44 LDLIBRARYPATH_ENVVAR = LIBPATH
46 ## Override Versioned target for a shared library.
47 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
48 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
50 # The following is for Makefile.inc's use.
51 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
53 # this one is for icudefs.mk's use
54 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 $@ $<
87 ../data/%.o: ../data/%.c
88 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
92 @$(SHELL) -ec 'cat $< \
93 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
94 [ -s $@ ] || rm -f $@ ; rm -f $<'
97 @echo "generating dependency information for $<"
98 @$(SHELL) -ec '$(GEN_DEPS.c) $< > /dev/null'
100 %.u : $(srcdir)/%.cpp
101 @echo "generating dependency information for $<"
102 @$(SHELL) -ec '$(GEN_DEPS.cc) $< > /dev/null'
105 ## Versioned libraries rules
106 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
107 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
108 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
109 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
112 ## BIR - bind with internal references [so app data and icu data doesn't collide]
113 BIR_LDFLAGS= -E$(NAME).map -bnoexpall
114 BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
115 BIR_DEPS= $(NAME).map
118 ## End Aix-specific setup